-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[DRAFT] Add changes to populate the data source metadata details #25127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
2bf5773
to
9f9bc37
Compare
9f9bc37
to
cd7ec48
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@evanvdia Thanks for the PR, I did a first pass and added a few suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@evanvdia I don't see this class being referenced anywhere. Is the PR missing some changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@imjalpreet I have added the changes.
|
||
import static java.util.Objects.requireNonNull; | ||
|
||
public class JdbcOutputMetaData |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: please rename to JdbcOutputMetadata
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
} | ||
|
||
@JsonProperty | ||
public String getInfo() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: please add @Override
annotation as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
import java.util.List; | ||
import java.util.Objects; | ||
|
||
public class HiveConnectorOutputMetadata |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: please rename this class as HiveOutputInfo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@JsonProperty("partitionNames") List<String> partitionNames, | ||
@JsonProperty("tableLocation") String tableLocation) | ||
{ | ||
this.partitionNames = partitionNames; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add null checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
partitionUpdates.stream() | ||
.map(PartitionUpdate::getName) | ||
.collect(toList()))); | ||
.collect(toList()), writeInfo.getTargetPath().getName()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we using writeInfo.getTargetPath().toString()
in one case and writeInfo.getTargetPath().getName()
in the other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
import static java.util.Objects.requireNonNull; | ||
|
||
public class HiveWrittenPartitions | ||
implements ConnectorOutputMetadata | ||
{ | ||
private final List<String> partitionNames; | ||
private final HiveConnectorOutputMetadata connectorOutputInfo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please rename the object as hiveOutputInfo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
{ | ||
this.partitionNames = ImmutableList.copyOf(requireNonNull(partitionNames, "partitionNames is null")); | ||
this.connectorOutputInfo = requireNonNull(connectorOutputInfo, "connectorOutputInfo is null"); | ||
} | ||
|
||
@JsonProperty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an @Override
annotation here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
IcebergTableLayoutHandle icebergTableHandle = (IcebergTableLayoutHandle) tableHandle; | ||
return Optional.of(new IcebergInputInfo( | ||
icebergTableHandle.getTable().getIcebergTableName().getSnapshotId(), | ||
icebergTableHandle.getTable().getOutputPath().get())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: please add null checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -570,9 +571,9 @@ private Optional<ConnectorOutputMetadata> finishInsert(ConnectorSession session, | |||
throw new PrestoException(ICEBERG_COMMIT_ERROR, "Failed to commit Iceberg update to table: " + writableTableHandle.getTableName(), e); | |||
} | |||
|
|||
return Optional.of(new HiveWrittenPartitions(commitTasks.stream() | |||
return Optional.of(new HiveWrittenPartitions(new HiveConnectorOutputMetadata(commitTasks.stream() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed we are not using IcebergWrittenPartitions
here, and the class is unused. We can do a small refactor. Let's remove IcebergWrittenPartitions
and also move HiveWrittenPartitions
from presto-hive
to presto-hive-common
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
facd048
to
5aaf7e9
Compare
5aaf7e9
to
a1a4003
Compare
Description
To achieve combined lineage tracking, add changes to populate the data source metadata details.
Motivation and Context
Issue: #25123
Impact
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.
If release note is NOT required, use: