You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "deniskuzZ (via GitHub)" <gi...@apache.org> on 2024/04/15 19:13:30 UTC
[PR] Draft: ORC projected size fix for ACID [hive]
deniskuzZ opened a new pull request, #5195:
URL: https://github.com/apache/hive/pull/5195
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/Hive/HowToContribute
2. Ensure that you have created an issue on the Hive project JIRA: https://issues.apache.org/jira/projects/HIVE/summary
3. Ensure you have added or run the appropriate tests for your PR:
4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]HIVE-XXXXX: Your PR title ...'.
5. Be sure to keep the PR description updated to reflect all changes.
6. Please write your PR title to summarize what this PR proposes.
7. If possible, provide a concise example to reproduce the issue for a faster review.
-->
### What changes were proposed in this pull request?
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->
### Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
-->
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description, screenshot and/or a reproducable example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released Hive versions or within the unreleased branches such as master.
If no, write 'No'.
-->
### Is the change a dependency upgrade?
<!--
If yes, please attach a file with output from mvn dependency:tree to validate a complete upgrade of dependency.
If no, write 'No'.
-->
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #5195:
URL: https://github.com/apache/hive/pull/5195#issuecomment-2067321233
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 [0 Accepted issues](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5195&metric=new_accepted_issues&view=list)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 No data about Coverage
 No data about Duplication
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "abstractdog (via GitHub)" <gi...@apache.org>.
abstractdog commented on code in PR #5195:
URL: https://github.com/apache/hive/pull/5195#discussion_r1615288791
##########
ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestInputOutputFormat.java:
##########
@@ -1837,6 +1836,26 @@ public void testProjectedColumnSize() throws Exception {
assertEquals(376804, result.getProjectedColumnsUncompressedSize());
}
+ @Test
+ public void testAcidProjectedColumnSize() throws Exception {
+ Path file = new Path(HiveTestUtils.getFileFromClasspath("bucket_00952_0"));
+ FileSystem fs = FileSystem.getLocal(conf).getRaw();
+
+ OrcInputFormat.Context context = new OrcInputFormat.Context(conf);
+ OrcInputFormat.SplitInfo splitInfo = new OrcInputFormat.SplitInfo(
+ context, fs, fs.getFileStatus(file), null, null, true, new ArrayList<>(), true, null, null);
+ OrcInputFormat.SplitGenerator splitter = new OrcInputFormat.SplitGenerator(splitInfo, null, true, true);
+
+ List<OrcSplit> results = splitter.call();
+ assertEquals(1, results.size());
+
+ OrcSplit result = results.get(0);
+ assertEquals(3, result.getStart());
+ assertEquals(900, result.getLength());
+ assertEquals(1, results.size());
+ assertEquals(1246255309, results.get(0).getProjectedColumnsUncompressedSize());
Review Comment:
nit: reuse result instead of results.get(0)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5195:
URL: https://github.com/apache/hive/pull/5195#discussion_r1615312714
##########
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java:
##########
@@ -1725,35 +1725,22 @@ private void populateAndCacheStripeDetails() throws IOException {
}
private long computeProjectionSize(List<OrcProto.Type> fileTypes,
- List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
- List<Integer> internalColIds = Lists.newArrayList();
+ List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
+ final List<Integer> internalColIds;
+ // exclude ORC `Root` and ACID `Row` struct elements to avoid full schema size estimation
if (fileIncluded == null) {
- // Add all.
- for (int i = 0; i < fileTypes.size(); i++) {
- internalColIds.add(i);
- }
+ internalColIds = IntStream.range(1, fileTypes.size())
+ .boxed().collect(Collectors.toList());
} else {
- for (int i = 0; i < fileIncluded.length; i++) {
- if (fileIncluded[i]) {
- internalColIds.add(i);
- }
- }
+ internalColIds = IntStream.range(1, fileTypes.size())
+ .filter(i -> fileIncluded[i])
+ .filter(i -> isOriginal || i != OrcRecordUpdater.ROW + 1)
Review Comment:
this is not a root column, that ACID <row> column. we should exclude `0` always + <row> struct id in case of non original ACID.
````
IntStream.range(1..) - excludes ORC root struct
isOriginal || i != OrcRecordUpdater.ROW + 1 - excludes ACID row struct
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5195:
URL: https://github.com/apache/hive/pull/5195#discussion_r1615312714
##########
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java:
##########
@@ -1725,35 +1725,22 @@ private void populateAndCacheStripeDetails() throws IOException {
}
private long computeProjectionSize(List<OrcProto.Type> fileTypes,
- List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
- List<Integer> internalColIds = Lists.newArrayList();
+ List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
+ final List<Integer> internalColIds;
+ // exclude ORC `Root` and ACID `Row` struct elements to avoid full schema size estimation
if (fileIncluded == null) {
- // Add all.
- for (int i = 0; i < fileTypes.size(); i++) {
- internalColIds.add(i);
- }
+ internalColIds = IntStream.range(1, fileTypes.size())
+ .boxed().collect(Collectors.toList());
} else {
- for (int i = 0; i < fileIncluded.length; i++) {
- if (fileIncluded[i]) {
- internalColIds.add(i);
- }
- }
+ internalColIds = IntStream.range(1, fileTypes.size())
+ .filter(i -> fileIncluded[i])
+ .filter(i -> isOriginal || i != OrcRecordUpdater.ROW + 1)
Review Comment:
this is not a root column, but ACID \<row\> column. we should exclude `0` always + <row> struct id in case of non original ACID.
````
IntStream.range(1..) - excludes ORC root struct
isOriginal || i != OrcRecordUpdater.ROW + 1 - excludes ACID row struct
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5195:
URL: https://github.com/apache/hive/pull/5195#discussion_r1615312714
##########
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java:
##########
@@ -1725,35 +1725,22 @@ private void populateAndCacheStripeDetails() throws IOException {
}
private long computeProjectionSize(List<OrcProto.Type> fileTypes,
- List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
- List<Integer> internalColIds = Lists.newArrayList();
+ List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
+ final List<Integer> internalColIds;
+ // exclude ORC `Root` and ACID `Row` struct elements to avoid full schema size estimation
if (fileIncluded == null) {
- // Add all.
- for (int i = 0; i < fileTypes.size(); i++) {
- internalColIds.add(i);
- }
+ internalColIds = IntStream.range(1, fileTypes.size())
+ .boxed().collect(Collectors.toList());
} else {
- for (int i = 0; i < fileIncluded.length; i++) {
- if (fileIncluded[i]) {
- internalColIds.add(i);
- }
- }
+ internalColIds = IntStream.range(1, fileTypes.size())
+ .filter(i -> fileIncluded[i])
+ .filter(i -> isOriginal || i != OrcRecordUpdater.ROW + 1)
Review Comment:
this is not a root column, but ACID <row> column. we should exclude `0` always + <row> struct id in case of non original ACID.
````
IntStream.range(1..) - excludes ORC root struct
isOriginal || i != OrcRecordUpdater.ROW + 1 - excludes ACID row struct
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "abstractdog (via GitHub)" <gi...@apache.org>.
abstractdog commented on code in PR #5195:
URL: https://github.com/apache/hive/pull/5195#discussion_r1570103070
##########
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java:
##########
@@ -1727,14 +1727,15 @@ private void populateAndCacheStripeDetails() throws IOException {
private long computeProjectionSize(List<OrcProto.Type> fileTypes,
List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
List<Integer> internalColIds = Lists.newArrayList();
+ int rootColumn = 0;
if (fileIncluded == null) {
// Add all.
- for (int i = 0; i < fileTypes.size(); i++) {
+ for (int i = rootColumn + 1; i < fileTypes.size(); i++) {
internalColIds.add(i);
}
} else {
- for (int i = 0; i < fileIncluded.length; i++) {
- if (fileIncluded[i]) {
+ for (int i = rootColumn + 1; i < fileIncluded.length; i++) {
+ if (fileIncluded[i] && (isOriginal || i != OrcRecordUpdater.ROW + 1)) {
Review Comment:
this condition is very vague and hard to understand for an average code reader, please include comments for every parts:
- isOriginal
- OrcRecordUpdater.ROW + 1
please add a unit test for computeProjectionSize, even if this means it has to become @VisibleForTesting package-private
the current getProjectedColumnsUncompressedSize unit tests assertions tells nothing about different scenarios
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] Draft: ORC projected size fix for ACID [hive]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #5195:
URL: https://github.com/apache/hive/pull/5195#issuecomment-2057694125
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 [0 Accepted issues](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5195&metric=new_accepted_issues&view=list)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 No data about Coverage
 No data about Duplication
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "abstractdog (via GitHub)" <gi...@apache.org>.
abstractdog commented on code in PR #5195:
URL: https://github.com/apache/hive/pull/5195#discussion_r1606063473
##########
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java:
##########
@@ -1727,14 +1727,15 @@ private void populateAndCacheStripeDetails() throws IOException {
private long computeProjectionSize(List<OrcProto.Type> fileTypes,
List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
List<Integer> internalColIds = Lists.newArrayList();
+ int rootColumn = 0;
Review Comment:
rootColumn doesn't seem to change, which is strange, I guess this is more like a constant instead
##########
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java:
##########
@@ -1727,14 +1727,15 @@ private void populateAndCacheStripeDetails() throws IOException {
private long computeProjectionSize(List<OrcProto.Type> fileTypes,
List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
List<Integer> internalColIds = Lists.newArrayList();
+ int rootColumn = 0;
Review Comment:
rootColumn variable doesn't seem to change, which is strange, I guess this is more like a constant instead
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "abstractdog (via GitHub)" <gi...@apache.org>.
abstractdog commented on code in PR #5195:
URL: https://github.com/apache/hive/pull/5195#discussion_r1570103070
##########
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java:
##########
@@ -1727,14 +1727,15 @@ private void populateAndCacheStripeDetails() throws IOException {
private long computeProjectionSize(List<OrcProto.Type> fileTypes,
List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
List<Integer> internalColIds = Lists.newArrayList();
+ int rootColumn = 0;
if (fileIncluded == null) {
// Add all.
- for (int i = 0; i < fileTypes.size(); i++) {
+ for (int i = rootColumn + 1; i < fileTypes.size(); i++) {
internalColIds.add(i);
}
} else {
- for (int i = 0; i < fileIncluded.length; i++) {
- if (fileIncluded[i]) {
+ for (int i = rootColumn + 1; i < fileIncluded.length; i++) {
+ if (fileIncluded[i] && (isOriginal || i != OrcRecordUpdater.ROW + 1)) {
Review Comment:
this condition is very vague and hard to understand for an average code reader, please include comments for every parts:
- isOriginal
- OrcRecordUpdater.ROW + 1
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5195:
URL: https://github.com/apache/hive/pull/5195#discussion_r1615312714
##########
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java:
##########
@@ -1725,35 +1725,22 @@ private void populateAndCacheStripeDetails() throws IOException {
}
private long computeProjectionSize(List<OrcProto.Type> fileTypes,
- List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
- List<Integer> internalColIds = Lists.newArrayList();
+ List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
+ final List<Integer> internalColIds;
+ // exclude ORC `Root` and ACID `Row` struct elements to avoid full schema size estimation
if (fileIncluded == null) {
- // Add all.
- for (int i = 0; i < fileTypes.size(); i++) {
- internalColIds.add(i);
- }
+ internalColIds = IntStream.range(1, fileTypes.size())
+ .boxed().collect(Collectors.toList());
} else {
- for (int i = 0; i < fileIncluded.length; i++) {
- if (fileIncluded[i]) {
- internalColIds.add(i);
- }
- }
+ internalColIds = IntStream.range(1, fileTypes.size())
+ .filter(i -> fileIncluded[i])
+ .filter(i -> isOriginal || i != OrcRecordUpdater.ROW + 1)
Review Comment:
this is not a root column, but ACID \<row\> column. we should exclude `0` always + \<row\> struct id in case of non original ACID.
````
IntStream.range(1..) - excludes ORC root struct
isOriginal || i != OrcRecordUpdater.ROW + 1 - excludes ACID row struct
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5195:
URL: https://github.com/apache/hive/pull/5195#discussion_r1615284720
##########
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java:
##########
@@ -1727,14 +1727,15 @@ private void populateAndCacheStripeDetails() throws IOException {
private long computeProjectionSize(List<OrcProto.Type> fileTypes,
List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
List<Integer> internalColIds = Lists.newArrayList();
+ int rootColumn = 0;
if (fileIncluded == null) {
// Add all.
- for (int i = 0; i < fileTypes.size(); i++) {
+ for (int i = rootColumn + 1; i < fileTypes.size(); i++) {
internalColIds.add(i);
}
} else {
- for (int i = 0; i < fileIncluded.length; i++) {
- if (fileIncluded[i]) {
+ for (int i = rootColumn + 1; i < fileIncluded.length; i++) {
+ if (fileIncluded[i] && (isOriginal || i != OrcRecordUpdater.ROW + 1)) {
Review Comment:
added. new test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "abstractdog (via GitHub)" <gi...@apache.org>.
abstractdog commented on code in PR #5195:
URL: https://github.com/apache/hive/pull/5195#discussion_r1615302602
##########
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java:
##########
@@ -1725,35 +1725,22 @@ private void populateAndCacheStripeDetails() throws IOException {
}
private long computeProjectionSize(List<OrcProto.Type> fileTypes,
- List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
- List<Integer> internalColIds = Lists.newArrayList();
+ List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
+ final List<Integer> internalColIds;
+ // exclude ORC `Root` and ACID `Row` struct elements to avoid full schema size estimation
if (fileIncluded == null) {
- // Add all.
- for (int i = 0; i < fileTypes.size(); i++) {
- internalColIds.add(i);
- }
+ internalColIds = IntStream.range(1, fileTypes.size())
+ .boxed().collect(Collectors.toList());
} else {
- for (int i = 0; i < fileIncluded.length; i++) {
- if (fileIncluded[i]) {
- internalColIds.add(i);
- }
- }
+ internalColIds = IntStream.range(1, fileTypes.size())
+ .filter(i -> fileIncluded[i])
+ .filter(i -> isOriginal || i != OrcRecordUpdater.ROW + 1)
Review Comment:
is it possible to reuse getRootColumn somehow? it would make more sense
```
public static int getRootColumn(boolean isOriginal) {
return isOriginal ? 0 : (OrcRecordUpdater.ROW + 1);
}
```
so maybe:
```
...
filter(i -> i != getRootColumn(isOriginal))
...
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5195:
URL: https://github.com/apache/hive/pull/5195#discussion_r1607234563
##########
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java:
##########
@@ -1727,14 +1727,15 @@ private void populateAndCacheStripeDetails() throws IOException {
private long computeProjectionSize(List<OrcProto.Type> fileTypes,
List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
List<Integer> internalColIds = Lists.newArrayList();
+ int rootColumn = 0;
Review Comment:
it's not supposed to, it's an index of the root struct element that should be skipped. I'll move it to constants
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #5195:
URL: https://github.com/apache/hive/pull/5195#issuecomment-2062038568
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 [0 Accepted issues](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5195&metric=new_accepted_issues&view=list)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 No data about Coverage
 No data about Duplication
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #5195:
URL: https://github.com/apache/hive/pull/5195#issuecomment-2065268383
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 [0 Accepted issues](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5195&metric=new_accepted_issues&view=list)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 No data about Coverage
 No data about Duplication
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5195:
URL: https://github.com/apache/hive/pull/5195#discussion_r1607234563
##########
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java:
##########
@@ -1727,14 +1727,15 @@ private void populateAndCacheStripeDetails() throws IOException {
private long computeProjectionSize(List<OrcProto.Type> fileTypes,
List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
List<Integer> internalColIds = Lists.newArrayList();
+ int rootColumn = 0;
Review Comment:
it's not supposed to, it's an index of the root struct element that should be skipped
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5195:
URL: https://github.com/apache/hive/pull/5195#discussion_r1615312714
##########
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java:
##########
@@ -1725,35 +1725,22 @@ private void populateAndCacheStripeDetails() throws IOException {
}
private long computeProjectionSize(List<OrcProto.Type> fileTypes,
- List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
- List<Integer> internalColIds = Lists.newArrayList();
+ List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
+ final List<Integer> internalColIds;
+ // exclude ORC `Root` and ACID `Row` struct elements to avoid full schema size estimation
if (fileIncluded == null) {
- // Add all.
- for (int i = 0; i < fileTypes.size(); i++) {
- internalColIds.add(i);
- }
+ internalColIds = IntStream.range(1, fileTypes.size())
+ .boxed().collect(Collectors.toList());
} else {
- for (int i = 0; i < fileIncluded.length; i++) {
- if (fileIncluded[i]) {
- internalColIds.add(i);
- }
- }
+ internalColIds = IntStream.range(1, fileTypes.size())
+ .filter(i -> fileIncluded[i])
+ .filter(i -> isOriginal || i != OrcRecordUpdater.ROW + 1)
Review Comment:
this is not a root column, that ACID <row> column. we should exclude `0` always + <row> struct id in case of non original ACID
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #5195:
URL: https://github.com/apache/hive/pull/5195#issuecomment-2063646851
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 [0 Accepted issues](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5195&metric=new_accepted_issues&view=list)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 No data about Coverage
 No data about Duplication
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] Draft: ORC projected size fix for ACID [hive]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #5195:
URL: https://github.com/apache/hive/pull/5195#issuecomment-2060730403
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 [0 Accepted issues](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5195&metric=new_accepted_issues&view=list)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 No data about Coverage
 No data about Duplication
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] Draft: ORC projected size fix for ACID [hive]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #5195:
URL: https://github.com/apache/hive/pull/5195#issuecomment-2059811247
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 [0 Accepted issues](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5195&metric=new_accepted_issues&view=list)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 No data about Coverage
 No data about Duplication
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "abstractdog (via GitHub)" <gi...@apache.org>.
abstractdog commented on code in PR #5195:
URL: https://github.com/apache/hive/pull/5195#discussion_r1570103070
##########
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java:
##########
@@ -1727,14 +1727,15 @@ private void populateAndCacheStripeDetails() throws IOException {
private long computeProjectionSize(List<OrcProto.Type> fileTypes,
List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
List<Integer> internalColIds = Lists.newArrayList();
+ int rootColumn = 0;
if (fileIncluded == null) {
// Add all.
- for (int i = 0; i < fileTypes.size(); i++) {
+ for (int i = rootColumn + 1; i < fileTypes.size(); i++) {
internalColIds.add(i);
}
} else {
- for (int i = 0; i < fileIncluded.length; i++) {
- if (fileIncluded[i]) {
+ for (int i = rootColumn + 1; i < fileIncluded.length; i++) {
+ if (fileIncluded[i] && (isOriginal || i != OrcRecordUpdater.ROW + 1)) {
Review Comment:
this condition is very vague and hard to understand for an average code reader, please include comments for every parts:
- isOriginal
- OrcRecordUpdater.ROW + 1
please add a unit test for computeProjectionSize, even if this means it has to become @VisibleForTesting package-private
unfortunately, the current getProjectedColumnsUncompressedSize unit test assertions tell nothing about different scenarios (they are more like noisy q.outs :) )
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #5195:
URL: https://github.com/apache/hive/pull/5195#issuecomment-2132326715
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195) **Quality Gate passed**
Issues
 [3 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5195&resolved=false&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5195&resolutions=WONTFIX)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5195&resolved=false&sinceLeakPeriod=true)
 No data about Coverage
 No data about Duplication
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5195:
URL: https://github.com/apache/hive/pull/5195#discussion_r1615325683
##########
ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestInputOutputFormat.java:
##########
@@ -1837,6 +1836,26 @@ public void testProjectedColumnSize() throws Exception {
assertEquals(376804, result.getProjectedColumnsUncompressedSize());
}
+ @Test
+ public void testAcidProjectedColumnSize() throws Exception {
+ Path file = new Path(HiveTestUtils.getFileFromClasspath("bucket_00952_0"));
+ FileSystem fs = FileSystem.getLocal(conf).getRaw();
+
+ OrcInputFormat.Context context = new OrcInputFormat.Context(conf);
+ OrcInputFormat.SplitInfo splitInfo = new OrcInputFormat.SplitInfo(
+ context, fs, fs.getFileStatus(file), null, null, true, new ArrayList<>(), true, null, null);
+ OrcInputFormat.SplitGenerator splitter = new OrcInputFormat.SplitGenerator(splitInfo, null, true, true);
+
+ List<OrcSplit> results = splitter.call();
+ assertEquals(1, results.size());
+
+ OrcSplit result = results.get(0);
+ assertEquals(3, result.getStart());
+ assertEquals(900, result.getLength());
+ assertEquals(1, results.size());
+ assertEquals(1246255309, results.get(0).getProjectedColumnsUncompressedSize());
Review Comment:
removed result
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #5195:
URL: https://github.com/apache/hive/pull/5195#issuecomment-2067770109
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 [0 Accepted issues](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5195&metric=new_accepted_issues&view=list)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 No data about Coverage
 No data about Duplication
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #5195:
URL: https://github.com/apache/hive/pull/5195#issuecomment-2066913265
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 [0 Accepted issues](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5195&metric=new_accepted_issues&view=list)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 No data about Coverage
 No data about Duplication
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #5195:
URL: https://github.com/apache/hive/pull/5195#issuecomment-2061483185
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 [0 Accepted issues](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5195&metric=new_accepted_issues&view=list)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5195&resolved=false&inNewCodePeriod=true)
 No data about Coverage
 No data about Duplication
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ commented on code in PR #5195:
URL: https://github.com/apache/hive/pull/5195#discussion_r1615312714
##########
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java:
##########
@@ -1725,35 +1725,22 @@ private void populateAndCacheStripeDetails() throws IOException {
}
private long computeProjectionSize(List<OrcProto.Type> fileTypes,
- List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
- List<Integer> internalColIds = Lists.newArrayList();
+ List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws FileFormatException {
+ final List<Integer> internalColIds;
+ // exclude ORC `Root` and ACID `Row` struct elements to avoid full schema size estimation
if (fileIncluded == null) {
- // Add all.
- for (int i = 0; i < fileTypes.size(); i++) {
- internalColIds.add(i);
- }
+ internalColIds = IntStream.range(1, fileTypes.size())
+ .boxed().collect(Collectors.toList());
} else {
- for (int i = 0; i < fileIncluded.length; i++) {
- if (fileIncluded[i]) {
- internalColIds.add(i);
- }
- }
+ internalColIds = IntStream.range(1, fileTypes.size())
+ .filter(i -> fileIncluded[i])
+ .filter(i -> isOriginal || i != OrcRecordUpdater.ROW + 1)
Review Comment:
this is not a root column, that Is an ACID <row> column. we should exclude `0` always + <row> struct id in case of non original ACID
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #5195:
URL: https://github.com/apache/hive/pull/5195#issuecomment-2132415837
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195) **Quality Gate passed**
Issues
 [3 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5195&resolved=false&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5195&resolutions=WONTFIX)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5195&resolved=false&sinceLeakPeriod=true)
 No data about Coverage
 No data about Duplication
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5195)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-28202: Incorrect projected column size after ORC upgrade to v1.6.7 [hive]
Posted by "deniskuzZ (via GitHub)" <gi...@apache.org>.
deniskuzZ merged PR #5195:
URL: https://github.com/apache/hive/pull/5195
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org