Skip to content

Spark: Use decimal128#13665

Closed
hsiang-c wants to merge 5 commits intoapache:mainfrom
hsiang-c:use_decimal128
Closed

Spark: Use decimal128#13665
hsiang-c wants to merge 5 commits intoapache:mainfrom
hsiang-c:use_decimal128

Conversation

@hsiang-c
Copy link
Copy Markdown
Contributor

No description provided.

@github-actions github-actions Bot added the spark label Jul 24, 2025
// Query and validate
List<Object[]> actual = sql("SELECT * FROM %s", tableName);
for (int i = 0; i < expected.size(); i++) {
System.out.println(actual.get(i)[0]);
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.

remove this?

List<Object[]> actual = sql("SELECT * FROM %s", tableName);
for (int i = 0; i < expected.size(); i++) {
System.out.println(actual.get(i)[0]);
assertEquals("Mismatch at row " + i, expected, actual);
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.

Are you comparing row by row?

assertEquals("Mismatch at row " + i, expected.get(i)[0], actual.get(i)[0]);

@TestTemplate
public void testDecimalColumn() {
int rows = 100;
String tableName = tableName("decimal_table1");
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.

Shall we use the class level field this.tableName instead?

this.tableName = tableName("decimal_table1");

then we will have the @AfterEach cleanup
sql("DROP TABLE IF EXISTS %s", tableName)

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.

I think if we switch to class level field this.tableName, then we don't need the TRUNCATE TABLE below.

@huaxingao
Copy link
Copy Markdown
Contributor

Thanks @hsiang-c for the PR! The PR looks good overall. I have a couple of minor comments. Could you please also add a brief description of this PR?

@huaxingao huaxingao changed the title Use decimal128 Spark: Use decimal128 Jul 28, 2025
@github-actions
Copy link
Copy Markdown

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.

@github-actions github-actions Bot added the stale label Aug 28, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 5, 2025

This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@github-actions github-actions Bot closed this Sep 5, 2025

@TestTemplate
public void testDecimalColumn() {
int rows = 100;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It would be good to try some other values - The range of integers between 513 and 1024 is likely to show a mismatch between the byte array base dBigInteger/BigDecimal encoding and the 128 bit native integer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants