这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@yigress
Copy link
Contributor

@yigress yigress commented Aug 3, 2022

What changes were proposed in this pull request?

Why are the changes needed?

Does this PR introduce any user-facing change?

How was this patch tested?

<module>testutils</module>
<module>packaging</module>
<module>standalone-metastore</module>
<module>upgrade-acid</module>
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove the pom.xml from the PR

final boolean isRepeating = keyColVector.isRepeating;
for (int i = 0; i < count; i++) {
final int keyOffset = offset + i;
final int len = isRepeating? keyLength[i]: keyLength[keyOffset];
Copy link
Contributor

Choose a reason for hiding this comment

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

Is that supposed to be [i] or [0]

The two rows look a bit wrong there.

I would write keyOffset = isRepeating ? 0 : offset + i

if the intention was to use =0 for all repeating.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found that the key is set isRepeating only when there is a single key (count=1), but I am not sure if different orc versions may have multiple keys, if there are multiple keys in repeating, keyLength may have multiple entries. Would it be better just deal with the isRepeating and count=1 separately?

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree with Gopal. If isRepeating=true, then keyLength and keyVector will have to be looked at index = 0. I was also expecting something like below

final int len = isRepeating? keyLength[0]: keyLength[keyOffset];

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the review @prasanthj ! updated. I only see isRepeating is true for one single key, but not sure if there can be multiple keys and still have isRepeating=true

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you update the test case with multiple keys and see if that produces expected result?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added test cases of repeating multiple keys and mixed keys.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@prasanthj appreciate your review!

@prasanthj
Copy link
Contributor

+1

@sunchao
Copy link
Member

sunchao commented Aug 5, 2022

Test failures unrelated. Merging now.

@sunchao sunchao merged commit 4b1f01f into apache:master Aug 5, 2022
@jfsii
Copy link
Contributor

jfsii commented Aug 6, 2022

Hi @sunchao / @yigress - I think some of the test failures could be related to this patch.

http://ci.hive.apache.org/blue/organizations/jenkins/hive-precommit/detail/PR-3492/3/pipeline/439 (which is from the run on this PR)

[2022-08-05T04:08:23.465Z] [ERROR] org.apache.hadoop.hive.cli.split16.TestMiniLlapLocalCliDriver.testCliDriver[orc_map_key_repeating] Time elapsed: 3.725 s <<< FAILURE!
[2022-08-05T04:08:23.465Z] java.lang.AssertionError:
[2022-08-05T04:08:23.465Z] Client Execution succeeded but contained differences (error code = 2) after executing orc_map_key_repeating.q
[2022-08-05T04:08:23.465Z] See ./ql/target/tmp/log/hive.log or ./itests/qtest/target/tmp/log/hive.log, or check ./ql/target/surefire-reports or ./itests/qtest/target/surefire-reports/ for specific test cases logs.
[2022-08-05T04:08:23.465Z] at org.junit.Assert.fail(Assert.java:89)

This PR directly added orc_map_key_repeating.

@jfsii
Copy link
Contributor

jfsii commented Aug 6, 2022

I've attempted to fix the situation - #3509

@sunchao
Copy link
Member

sunchao commented Aug 6, 2022

@jfsii oops sorry, I'll take a look at the fix

@yigress
Copy link
Contributor Author

yigress commented Aug 9, 2022

sorry about this. thank you @sunchao @jfsii !

@jfsii
Copy link
Contributor

jfsii commented Aug 10, 2022

sorry about this. thank you @sunchao @jfsii !

No problem @yigress - it is an easy mistake to make. Thanks for your contribution to the project!

DongWei-4 pushed a commit to DongWei-4/hive that referenced this pull request Oct 28, 2022
dengzhhu653 pushed a commit to dengzhhu653/hive that referenced this pull request Dec 15, 2022
byte[] rowKey = isRepeating? keyVector[0]: keyVector[keyOffset];
if (StringExpr.equal(key, 0, key.length,
keyVector[keyOffset], keyStart[keyOffset], keyLength[keyOffset])) {
rowKey, keyStart[keyOffset], len)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

keyStart[keyOffset] should also be assigned based on isRepeating key.

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.

7 participants