Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Aitozi committed Nov 14, 2022
1 parent 273b123 commit 4c3b6bf
Showing 1 changed file with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

package org.apache.flink.connectors.hive.read;

import org.apache.flink.connectors.hive.HiveOptions;
import org.apache.flink.connectors.hive.HiveTablePartition;
import org.apache.flink.connectors.hive.util.JobConfUtils;
import org.apache.flink.table.api.SqlDialect;
import org.apache.flink.table.api.TableEnvironment;
import org.apache.flink.table.api.TableSchema;
Expand All @@ -30,6 +32,7 @@
import org.apache.flink.util.CollectionUtil;

import org.apache.hadoop.hive.metastore.api.Table;
import org.apache.hadoop.mapred.JobConf;
import org.junit.Test;

import java.util.Collections;
Expand Down Expand Up @@ -58,18 +61,20 @@ private void testReadFormat(TableEnvironment tableEnv, HiveCatalog hiveCatalog,
ObjectPath tablePath = new ObjectPath("default", tableName);
TableSchema tableSchema = hiveCatalog.getTable(tablePath).getSchema();
// create partition reader
HiveInputFormatPartitionReader partitionReader = null;
// new HiveInputFormatPartitionReader(
//
// HiveOptions.TABLE_EXEC_HIVE_LOAD_PARTITION_SPLITS_THREAD_NUM.defaultValue(),
// new JobConf(hiveCatalog.getHiveConf()),
// hiveCatalog.getHiveVersion(),
// tablePath,
// tableSchema.getFieldDataTypes(),
// tableSchema.getFieldNames(),
// Collections.emptyList(),
// null,
// false);
HiveInputFormatPartitionReader partitionReader =
new HiveInputFormatPartitionReader(
HiveOptions.TABLE_EXEC_HIVE_LOAD_PARTITION_SPLITS_THREAD_NUM.defaultValue(),
new JobConf(hiveCatalog.getHiveConf()),
hiveCatalog.getHiveVersion(),
tablePath,
tableSchema.getFieldDataTypes(),
tableSchema.getFieldNames(),
Collections.emptyList(),
null,
false,
tableSchema.toRowDataType(),
JobConfUtils.getDefaultPartitionName(
new JobConf(hiveCatalog.getHiveConf())));
Table hiveTable = hiveCatalog.getHiveTable(tablePath);
// create HiveTablePartition to read from
HiveTablePartition tablePartition =
Expand Down

0 comments on commit 4c3b6bf

Please sign in to comment.