Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ public final class SparkDpp implements java.io.Serializable {
private SparkSession spark = null;
private EtlJobConfig etlJobConfig = null;
private LongAccumulator abnormalRowAcc = null;
private LongAccumulator unselectedRowAcc = null;
private LongAccumulator scannedRowsAcc = null;
private LongAccumulator fileNumberAcc = null;
private LongAccumulator fileSizeAcc = null;
Expand All @@ -120,7 +119,6 @@ public SparkDpp(SparkSession spark, EtlJobConfig etlJobConfig) {

public void init() {
abnormalRowAcc = spark.sparkContext().longAccumulator("abnormalRowAcc");
unselectedRowAcc = spark.sparkContext().longAccumulator("unselectedRowAcc");
scannedRowsAcc = spark.sparkContext().longAccumulator("scannedRowsAcc");
fileNumberAcc = spark.sparkContext().longAccumulator("fileNumberAcc");
fileSizeAcc = spark.sparkContext().longAccumulator("fileSizeAcc");
Expand Down Expand Up @@ -854,6 +852,10 @@ private Dataset<Row> loadDataFromHiveTable(SparkSession spark,
sql.append(column.columnName).append(",");
});
sql.deleteCharAt(sql.length() - 1).append(" from ").append(hiveDbTableName);
if (!Strings.isNullOrEmpty(fileGroup.where)) {
sql.append(" where ").append(fileGroup.where);
}

Dataset<Row> dataframe = spark.sql(sql.toString());
dataframe = checkDataFromHiveWithStrictMode(dataframe, baseIndex, fileGroup.columnMappings.keySet(), etlJobConfig.properties.strictMode,
dstTableSchema);
Expand Down Expand Up @@ -988,12 +990,6 @@ private void process() throws Exception {
LOG.info("no data for file file group:" + fileGroup);
continue;
}
if (!Strings.isNullOrEmpty(fileGroup.where)) {
long originalSize = fileGroupDataframe.count();
fileGroupDataframe = fileGroupDataframe.filter(fileGroup.where);
long currentSize = fileGroupDataframe.count();
unselectedRowAcc.add(currentSize - originalSize);
}

JavaPairRDD<List<Object>, Object[]> ret = fillTupleWithPartitionColumn(
fileGroupDataframe,
Expand Down