marton-bod commented on a change in pull request #3242:
URL: https://github.com/apache/iceberg/pull/3242#discussion_r731680585
##########
File path:
mr/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergInputFormat.java
##########
@@ -100,19 +104,37 @@
.toArray(InputSplit[]::new);
}
+ @VisibleForTesting
+ void checkHive3Present() {
+ Preconditions.checkArgument(HIVE_3_PRESENT_ON_CLASSPATH, "Vectorization
only supported for Hive 3+");
+ }
+
+ @VisibleForTesting
+ RecordReader<Void, Container<Record>> getVectorizedRecordReader(IcebergSplit
icebergSplit,
+
JobConf job,
+
Reporter reporter) {
+ return (RecordReader) HIVE_VECTORIZED_RECORDREADER_CTOR.newInstance(
+ new IcebergInputFormat<>(),
+ icebergSplit,
+ job,
+ reporter);
+ }
+
@Override
public RecordReader<Void, Container<Record>> getRecordReader(InputSplit
split, JobConf job,
Reporter
reporter) throws IOException {
String[] selectedColumns = ColumnProjectionUtils.getReadColumnNames(job);
job.setStrings(InputFormatConfig.SELECTED_COLUMNS, selectedColumns);
-
- if (HiveConf.getBoolVar(job,
HiveConf.ConfVars.HIVE_VECTORIZATION_ENABLED)) {
- Preconditions.checkArgument(MetastoreUtil.hive3PresentOnClasspath(),
"Vectorization only supported for Hive 3+");
-
+ boolean isVectorized = HiveConf.getBoolVar(job,
HiveConf.ConfVars.HIVE_VECTORIZATION_ENABLED) &&
Review comment:
Can you use `boolean isVectorized = TezUtil.isVectorized()` here? seems
to be the same logic
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]