pavibhai commented on code in PR #1387:
URL: https://github.com/apache/orc/pull/1387#discussion_r1100240522
##########
java/core/src/java/org/apache/orc/impl/WriterImpl.java:
##########
@@ -189,8 +189,12 @@ public WriterImpl(FileSystem fs,
this.rowIndexStride = 0;
}
- // ORC-1343: We ignore `opts.isBuildIndex` due to the lack of reader
support
- this.buildIndex = rowIndexStride > 0;
+ if (!opts.isBuildIndex() && rowIndexStride > 0) {
+ throw new IllegalArgumentException("Please set rowIndexStride to zero " +
Review Comment:
I was looking at the WriterOptions. Was thinking if we should integrate if
there as well. There seem to be 2 places of interest right now.
Constructor. We currently have
```java
buildIndex = OrcConf.ENABLE_INDEXES.getBoolean(tableProperties, conf);
rowIndexStrideValue =
(int) OrcConf.ROW_INDEX_STRIDE.getLong(tableProperties, conf);
```
We should set rowIndexStrideValue to 0 if `buildIndex` is false
Setter for rowIndexStride (I don't see a setter for buildIndex)
```java
public WriterOptions rowIndexStride(int value) {
rowIndexStrideValue = value;
return this;
}
```
Adapt this to say if rowIndexStride is 0 then set buildIndex false, else if
rowIndexStride > 0 set buildIndex true.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]