Skip to content

Refactor Java Hive and Iceberg Connector for Prestissimo Iceberg Connector#21662

Merged
yingsu00 merged 5 commits intoprestodb:masterfrom
imjalpreet:icebergPrestissimoJavaChanges
Jan 18, 2024
Merged

Refactor Java Hive and Iceberg Connector for Prestissimo Iceberg Connector#21662
yingsu00 merged 5 commits intoprestodb:masterfrom
imjalpreet:icebergPrestissimoJavaChanges

Conversation

@imjalpreet
Copy link
Member

Description

Related to #21584

Motivation and Context

facebookincubator/velox#5977

Impact

N.A.

Test Plan

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== NO RELEASE NOTE ==

@imjalpreet imjalpreet self-assigned this Jan 9, 2024
@imjalpreet imjalpreet requested a review from a team as a code owner January 9, 2024 20:24
@imjalpreet imjalpreet requested a review from presto-oss January 9, 2024 20:24
@imjalpreet imjalpreet added the iceberg Apache Iceberg related label Jan 9, 2024
@imjalpreet imjalpreet requested a review from yingsu00 January 9, 2024 21:16
@imjalpreet imjalpreet force-pushed the icebergPrestissimoJavaChanges branch from 66cffe5 to 9e2428b Compare January 10, 2024 06:44
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need to cast to HiveColumnHandle

Set<String> relevantColumns = tableHandle.getPartitionColumns().stream()
                .map(BaseHiveColumnHandle::getName)

Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need to cast to HiveColumnHandle

Set<String> relevantColumns = tableHandle.getPartitionColumns().stream()
                .map(BaseHiveColumnHandle::getName)

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't usually do upcasts in the child classes. I think it's better to change the parameter partitionColumns to List<BaseColumnHandle>

Copy link
Contributor

Choose a reason for hiding this comment

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

Change
public Builder setPartitionColumns(List<HiveColumnHandle> partitionColumns)
to
public Builder setPartitionColumns(List<BaseHiveColumnHandle> partitionColumns)
and do downcast inside.

Copy link
Contributor

Choose a reason for hiding this comment

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

same

@imjalpreet imjalpreet force-pushed the icebergPrestissimoJavaChanges branch from 9e2428b to 9c7bd6b Compare January 11, 2024 10:29
@imjalpreet imjalpreet marked this pull request as draft January 11, 2024 11:05
@imjalpreet imjalpreet force-pushed the icebergPrestissimoJavaChanges branch from 9c7bd6b to c67f699 Compare January 11, 2024 12:26
@imjalpreet imjalpreet marked this pull request as ready for review January 11, 2024 13:17
@imjalpreet imjalpreet requested a review from yingsu00 January 11, 2024 16:21
Copy link
Contributor

Choose a reason for hiding this comment

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

getSchemaTableName() is already in BaseHiveTableHandle. Do we still need it here?

Copy link
Contributor

Choose a reason for hiding this comment

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

We can make HivePartitionResult.partitionColumns List<HiveColumnHandle>, and make hivePartitionResult.getPartitionColumns() return List<BaseHiveColumnHandle>, and also make the constructor of HivePartitionResult take List<BaseHiveColumnHandle> parameter.

Copy link
Contributor

Choose a reason for hiding this comment

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

change the constructor parameter partitionColumns to List<BaseHiveColumnHandle> instead of doing upcasting here

Copy link
Member Author

Choose a reason for hiding this comment

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

As discussed offline, we won't be able to make this change in the JSON constructor since we don't want the information to get lost while serializing.

@imjalpreet imjalpreet force-pushed the icebergPrestissimoJavaChanges branch from c67f699 to 2cef922 Compare January 18, 2024 10:03
@imjalpreet imjalpreet force-pushed the icebergPrestissimoJavaChanges branch from 2cef922 to 9be76e6 Compare January 18, 2024 12:20
@imjalpreet imjalpreet force-pushed the icebergPrestissimoJavaChanges branch from 9be76e6 to a3ebbb4 Compare January 18, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

iceberg Apache Iceberg related

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants