Support DECIMAL and remove DOUBLE in TPCH Connector#11166
Support DECIMAL and remove DOUBLE in TPCH Connector#11166atris wants to merge 3 commits intoprestodb:masterfrom
Conversation
| @@ -5,9 +5,17 @@ | |||
| <parent> | |||
There was a problem hiding this comment.
Changes made to this file will be reverted prior to merging. Please ignore these changes
kokosing
left a comment
There was a problem hiding this comment.
Please squash all the fixup commits. Do all the tests are passing?
| <parent> | ||
| <groupId>io.airlift</groupId> | ||
| <artifactId>airbase</artifactId> | ||
| <version>80</version> |
There was a problem hiding this comment.
it looks like you depends on other PR which is in progress, it should be a separate commit (cherry-picked)
There was a problem hiding this comment.
Please see:
#11166 (comment)
It is hard for me to locally separate out this commit, and my local testing needs these changes. Hence I raised this as part of the PR, will revert before merging. Please ignore any changes to this file
There was a problem hiding this comment.
Please see:
#11166 (comment)
It is hard for me to locally separate out this commit, and my local testing needs these changes. Hence I raised this as part of the PR, will revert before merging. Please ignore any changes to this file
| <name>Local AirLift Repo</name> | ||
| <url>/Users/atrisharma/tpch/target</url> | ||
| </repository> | ||
| </repositories> |
| <artifactId>tpch</artifactId> | ||
| <version>0.9</version> | ||
| </dependency> | ||
|
|
| case DOUBLE: | ||
| return column.getDouble(row); | ||
| case DECIMAL: | ||
| return column.getIdentifier(row); |
There was a problem hiding this comment.
getIdentifier returns the long value of the column, should it not work for this case?
| case DOUBLE: | ||
| return DOUBLE; | ||
| case DECIMAL: | ||
| return DECIMAL; |
There was a problem hiding this comment.
you should return DECIMAL(12,2), use com.facebook.presto.spi.type.DecimalType#createDecimalType(int, int)
| { | ||
| public static final int DEFAULT_SCALE = 0; | ||
| public static final int DEFAULT_PRECISION = MAX_PRECISION; | ||
| public static final DecimalType DECIMAL = createDecimalType(12, 2); |
There was a problem hiding this comment.
Types usually have a static created type (e.g. DOUBLE etc), hence I created one for DECIMAL. I will use createDecimal everywhere instead
There was a problem hiding this comment.
I was following the usual pattern of types having a static instance which can be returned. I will use createDecimal
|
I think some classes in You might want to try running: |
|
This pull request has been automatically marked as stale because it has not had recent activity. If you'd still like this PR merged, please comment on the task, make sure you've addressed reviewer comments, and rebase on the latest master. Thank you for your contributions! |
Fixes #3557
Airlift PR: trinodb/tpch#23