Skip to content

Support DECIMAL and remove DOUBLE in TPCH Connector#11166

Closed
atris wants to merge 3 commits intoprestodb:masterfrom
atris:tpch_decimal_fix
Closed

Support DECIMAL and remove DOUBLE in TPCH Connector#11166
atris wants to merge 3 commits intoprestodb:masterfrom
atris:tpch_decimal_fix

Conversation

@atris
Copy link
Copy Markdown

@atris atris commented Aug 1, 2018

Fixes #3557

Airlift PR: trinodb/tpch#23

Comment thread pom.xml
@@ -5,9 +5,17 @@
<parent>
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes made to this file will be reverted prior to merging. Please ignore these changes

@atris atris requested a review from kokosing August 1, 2018 08:56
@atris atris mentioned this pull request Aug 1, 2018
Copy link
Copy Markdown
Contributor

@kokosing kokosing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash all the fixup commits. Do all the tests are passing?

Comment thread pom.xml
<parent>
<groupId>io.airlift</groupId>
<artifactId>airbase</artifactId>
<version>80</version>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like you depends on other PR which is in progress, it should be a separate commit (cherry-picked)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread pom.xml
<name>Local AirLift Repo</name>
<url>/Users/atrisharma/tpch/target</url>
</repository>
</repositories>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread pom.xml
<artifactId>tpch</artifactId>
<version>0.9</version>
</dependency>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not move

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

case DOUBLE:
return column.getDouble(row);
case DECIMAL:
return column.getIdentifier(row);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you mean long?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getIdentifier returns the long value of the column, should it not work for this case?

case DOUBLE:
return DOUBLE;
case DECIMAL:
return DECIMAL;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should return DECIMAL(12,2), use com.facebook.presto.spi.type.DecimalType#createDecimalType(int, int)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack

{
public static final int DEFAULT_SCALE = 0;
public static final int DEFAULT_PRECISION = MAX_PRECISION;
public static final DecimalType DECIMAL = createDecimalType(12, 2);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please undo

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Types usually have a static created type (e.g. DOUBLE etc), hence I created one for DECIMAL. I will use createDecimal everywhere instead

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was following the usual pattern of types having a static instance which can be returned. I will use createDecimal

@sopel39
Copy link
Copy Markdown
Contributor

sopel39 commented Aug 8, 2018

I think some classes in presto-benchmark/src/main/java/com/facebook/presto/benchmark need to be modified/removed as well.

You might want to try running: com.facebook.presto.benchmark.TestBenchmarks

@stale
Copy link
Copy Markdown

stale bot commented Apr 3, 2019

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!

@stale stale bot added the stale label Apr 3, 2019
@stale stale bot closed this Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants