You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ch...@apache.org on 2023/11/08 15:13:57 UTC
(carbondata) branch master updated: [ISSUE-4338] Fix checkstyle issue in sdk module (#4339)
This is an automated email from the ASF dual-hosted git repository.
chenliang613 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/carbondata.git
The following commit(s) were added to refs/heads/master by this push:
new 4a1b36ff5b [ISSUE-4338] Fix checkstyle issue in sdk module (#4339)
4a1b36ff5b is described below
commit 4a1b36ff5b35346acffcd505fed12c7c625548a5
Author: david <qi...@qq.com>
AuthorDate: Wed Nov 8 23:13:51 2023 +0800
[ISSUE-4338] Fix checkstyle issue in sdk module (#4339)
Co-authored-by: QiangCai <da...@gmail.com>
---
.../TimestampDataTypeDirectDictionaryTestCase.scala | 2 +-
.../org/apache/carbondata/sdk/file/CarbonSchemaReader.java | 14 +++++---------
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/directdictionary/TimestampDataTypeDirectDictionaryTestCase.scala b/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/directdictionary/TimestampDataTypeDirectDictionaryTestCase.scala
index 3260dacb6f..3043833e3a 100644
--- a/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/directdictionary/TimestampDataTypeDirectDictionaryTestCase.scala
+++ b/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/directdictionary/TimestampDataTypeDirectDictionaryTestCase.scala
@@ -154,7 +154,7 @@ class TimestampDataTypeDirectDictionaryTest extends QueryTest with BeforeAndAfte
sql(
"create table test_timestamp_hive(col timestamp) row format delimited fields terminated by " +
"','")
- sql("load data inpath '" + csvFilePath + "' into table test_timestamp_hive ")
+ sql("load data local inpath '" + csvFilePath + "' into table test_timestamp_hive ")
checkAnswer(sql(
"select col from test_timestamp where col not between '2014-01-01 18:00:00' and '0'"),
sql("select col from test_timestamp_hive where col not between '2014-01-01 18:00:00' and " +
diff --git a/sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonSchemaReader.java b/sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonSchemaReader.java
index f2d594ba24..31421d9bb9 100644
--- a/sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonSchemaReader.java
+++ b/sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonSchemaReader.java
@@ -49,10 +49,6 @@ import org.apache.carbondata.sdk.file.arrow.ArrowConverter;
import org.apache.hadoop.conf.Configuration;
-import static org.apache.carbondata.core.util.CarbonUtil.thriftColumnSchemaToWrapperColumnSchema;
-import static org.apache.carbondata.core.util.path.CarbonTablePath.CARBON_DATA_EXT;
-import static org.apache.carbondata.core.util.path.CarbonTablePath.INDEX_FILE_EXT;
-
/**
* Schema reader for carbon files, including carbondata file, carbonindex file, and schema file
*/
@@ -172,12 +168,12 @@ public class CarbonSchemaReader {
if (FileFactory.getCarbonFile(schemaFilePath, conf).exists()) {
return readSchemaInSchemaFile(schemaFilePath, conf);
}
- if (path.endsWith(INDEX_FILE_EXT)) {
+ if (path.endsWith(CarbonTablePath.INDEX_FILE_EXT)) {
return readSchemaFromIndexFile(path, conf);
- } else if (path.endsWith(CARBON_DATA_EXT)) {
+ } else if (path.endsWith(CarbonTablePath.CARBON_DATA_EXT)) {
return readSchemaFromDataFile(path, conf);
} else if (validateSchema) {
- CarbonFile[] carbonIndexFiles = getCarbonFile(path, INDEX_FILE_EXT, conf);
+ CarbonFile[] carbonIndexFiles = getCarbonFile(path, CarbonTablePath.INDEX_FILE_EXT, conf);
Schema schema;
if (carbonIndexFiles != null && carbonIndexFiles.length != 0) {
schema = readSchemaFromIndexFile(carbonIndexFiles[0].getAbsolutePath(), conf);
@@ -187,7 +183,7 @@ public class CarbonSchemaReader {
throw new CarbonDataLoadingException("Schema is different between different files.");
}
}
- CarbonFile[] carbonDataFiles = getCarbonFile(path, CARBON_DATA_EXT, conf);
+ CarbonFile[] carbonDataFiles = getCarbonFile(path, CarbonTablePath.CARBON_DATA_EXT, conf);
for (int i = 0; i < carbonDataFiles.length; i++) {
Schema schema2 = readSchemaFromDataFile(carbonDataFiles[i].getAbsolutePath(), conf);
if (!schema.equals(schema2)) {
@@ -379,7 +375,7 @@ public class CarbonSchemaReader {
readIndexHeader.getTable_columns();
for (org.apache.carbondata.format.ColumnSchema columnSchema : tableColumns) {
if (!(columnSchema.column_name.contains("."))) {
- columnSchemaList.add(thriftColumnSchemaToWrapperColumnSchema(columnSchema));
+ columnSchemaList.add(CarbonUtil.thriftColumnSchemaToWrapperColumnSchema(columnSchema));
}
}
return new Schema(columnSchemaList);