-
Notifications
You must be signed in to change notification settings - Fork 3k
Use equals() instead of Ref. equality #2716
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -171,6 +171,7 @@ public Type visit(MapType mapType) { | |
| } | ||
|
|
||
| @Override | ||
| @SuppressWarnings("ReferenceEquality") | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is for the |
||
| public Type visit(RowType rowType) { | ||
| List<Types.NestedField> newFields = Lists.newArrayListWithExpectedSize(rowType.getFieldCount()); | ||
| boolean isRoot = root == rowType; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -372,7 +372,7 @@ public static void importSparkTable(SparkSession spark, TableIdentifier sourceTa | |
| try { | ||
| PartitionSpec spec = SparkSchemaUtil.specForTable(spark, sourceTableIdentWithDB.unquotedString()); | ||
|
|
||
| if (spec == PartitionSpec.unpartitioned()) { | ||
| if (Objects.equal(spec, PartitionSpec.unpartitioned())) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. checking for ref. equality is probably fine here, but it takes a reader longer to navigate the code and figure out whether ref equality is really wanted here vs just using |
||
| importUnpartitionedSparkTable(spark, sourceTableIdentWithDB, targetTable); | ||
| } else { | ||
| List<SparkPartition> sourceTablePartitions = getPartitions(spark, sourceTableIdent); | ||
|
|
||
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.
even though using Ref equlity is correct here, it just takes the reader much longer to verify whether it's the intention or not than just using
equals()here