Skip to content
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

[AMORO-2204] Support Spark 3.5 for mixed format tables #3428

Open
wants to merge 82 commits into
base: master
Choose a base branch
from

Conversation

zhoujinsong
Copy link
Contributor

Why are the changes needed?

Close #2204.

Brief change log

  • Add spark 3.5 support for mixed format tables

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before making a pull request

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable)

@github-actions github-actions bot added module:mixed-spark Spark module for Mixed Format module:ams-server Ams server module module:ams-optimizer AMS optimizer module type:build module:ams-dashboard Ams dashboard module module:common labels Feb 5, 2025
@github-actions github-actions bot removed module:ams-optimizer AMS optimizer module module:ams-dashboard Ams dashboard module labels Feb 5, 2025
@czy006 czy006 self-requested a review February 5, 2025 03:36
@czy006 czy006 requested a review from zhongqishang February 14, 2025 03:26
@zhoujinsong zhoujinsong added this to the Release 0.8.0 milestone Mar 12, 2025
Copy link
Contributor

@Aireed Aireed left a comment

Choose a reason for hiding this comment

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

i left some tiny comment. PTAL

protected TableIdentifier generateChangeStoreIdentifier(TableIdentifier baseIdentifier) {
return TableIdentifier.of(
baseIdentifier.namespace(),
baseIdentifier.name() + CHANGE_STORE_SEPARATOR + MixedTable.CHANGE_STORE_IDENTIFIER);
Copy link
Contributor

Choose a reason for hiding this comment

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

should we replace CHANGE_STORE_SEPARATOR to this.separtor

Suggested change
baseIdentifier.name() + CHANGE_STORE_SEPARATOR + MixedTable.CHANGE_STORE_IDENTIFIER);
baseIdentifier.name() + CHANGE_STORE_SEPARATOR + MixedTable.CHANGE_STORE_IDENTIFIER);

@@ -43,7 +44,6 @@
public class InternalMixedIcebergCatalog extends BasicMixedIcebergCatalog {

public static final String CHANGE_STORE_SEPARATOR = "@";
Copy link
Contributor

Choose a reason for hiding this comment

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

@ is not validate for table name in hive

Suggested change
public static final String CHANGE_STORE_SEPARATOR = "@";
public static final String CHANGE_STORE_SEPARATOR = "@";

properties.remove(TableCatalog.PROP_LOCATION);
}
try {
if (properties.containsKey("primary.keys")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

should we add a definition in TableProperties.class for "primary.keys" ?

// one order leads to different results
Preconditions.checkArgument(
setSnapshotId == null || pickSnapshotId == null,
"Cannot set the current the current snapshot ID and cherry-pick snapshot changes");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"Cannot set the current the current snapshot ID and cherry-pick snapshot changes");
"Cannot set the current snapshot ID and cherry-pick snapshot changes at the same time");

Map<String, String> properties = Maps.newHashMap();
properties.putAll(sourceTable.properties());
EXCLUDED_PROPERTIES.forEach(properties::remove);
properties.put(TableCatalog.PROP_PROVIDER, "arctic");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
properties.put(TableCatalog.PROP_PROVIDER, "arctic");
properties.put(TableCatalog.PROP_PROVIDER, "mixed_hive");

properties.putAll(sourceTable.properties());
EXCLUDED_PROPERTIES.forEach(properties::remove);
properties.put(TableCatalog.PROP_PROVIDER, "arctic");
properties.put("migrated", "true");
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a prefix to indicate that this parameter is used by amoro.

Suggested change
properties.put("migrated", "true");
properties.put("amoro.migrated", "true");

Copy link
Contributor

@baiyangtx baiyangtx left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:ams-server Ams server module module:common module:mixed-spark Spark module for Mixed Format type:build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Add Support for Spark 3.4+
4 participants