[GitHub] [carbondata] nihal0107 commented on a change in pull request #3878: [CARBONDATA-3947]Fixed Hive read/write operation for Insert into Select operation.

2020-08-11 Thread GitBox


nihal0107 commented on a change in pull request #3878:
URL: https://github.com/apache/carbondata/pull/3878#discussion_r468359455



##
File path: 
integration/hive/src/main/java/org/apache/carbondata/hive/MapredCarbonInputFormat.java
##
@@ -213,6 +223,45 @@ private QueryModel getQueryModel(Configuration 
configuration, String path)
 .build();
   }
 
+  private static CarbonTable getCarbonTable(Configuration tableProperties)

Review comment:
   done





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [carbondata] nihal0107 commented on a change in pull request #3878: [CARBONDATA-3947]Fixed Hive read/write operation for Insert into Select operation.

2020-08-11 Thread GitBox


nihal0107 commented on a change in pull request #3878:
URL: https://github.com/apache/carbondata/pull/3878#discussion_r468359349



##
File path: 
integration/hive/src/main/java/org/apache/carbondata/hive/MapredCarbonInputFormat.java
##
@@ -213,6 +223,45 @@ private QueryModel getQueryModel(Configuration 
configuration, String path)
 .build();
   }
 
+  private static CarbonTable getCarbonTable(Configuration tableProperties)
+  throws InvalidConfigurationException, IOException, SQLException {
+String[] tableUniqueName = tableProperties.get("name").split("\\.");
+String databaseName = tableUniqueName[0];
+String tableName = tableUniqueName[1];
+String tablePath = 
tableProperties.get(hive_metastoreConstants.META_TABLE_LOCATION);
+String columns = 
tableProperties.get(hive_metastoreConstants.META_TABLE_COLUMNS);
+String sortColumns = tableProperties.get("sort_columns");
+String columnTypes = 
tableProperties.get(hive_metastoreConstants.META_TABLE_COLUMN_TYPES);
+String partitionColumns =
+
tableProperties.get(hive_metastoreConstants.META_TABLE_PARTITION_COLUMNS);
+String partitionColumnTypes =
+
tableProperties.get(hive_metastoreConstants.META_TABLE_PARTITION_COLUMN_TYPES);
+if (partitionColumns != null) {
+  columns = columns + "," + partitionColumns;
+  columnTypes = columnTypes + ":" + partitionColumnTypes;
+}
+String[] columnTypeArray = 
HiveCarbonUtil.splitSchemaStringToArray(columnTypes);
+
+AbsoluteTableIdentifier absoluteTableIdentifier = AbsoluteTableIdentifier
+.from(tableProperties.get(hive_metastoreConstants.META_TABLE_LOCATION),
+getDatabaseName(tableProperties), getTableName(tableProperties));
+String schemaPath =
+
CarbonTablePath.getSchemaFilePath(absoluteTableIdentifier.getTablePath(), 
tableProperties);
+
+CarbonTable carbonTable;
+String carbonDataFile = CarbonUtil.getFilePathExternalFilePath(schemaPath, 
tableProperties);
+if (carbonDataFile == null) {

Review comment:
   done.





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [carbondata] nihal0107 commented on a change in pull request #3878: [CARBONDATA-3947]Fixed Hive read/write operation for Insert into Select operation.

2020-08-11 Thread GitBox


nihal0107 commented on a change in pull request #3878:
URL: https://github.com/apache/carbondata/pull/3878#discussion_r468359209



##
File path: 
integration/hive/src/main/java/org/apache/carbondata/hive/MapredCarbonInputFormat.java
##
@@ -202,7 +212,7 @@ protected void setFilterPredicates(Configuration 
configuration, CarbonTable carb
   }
 
   private QueryModel getQueryModel(Configuration configuration, String path)
-  throws IOException, InvalidConfigurationException {
+  throws IOException, InvalidConfigurationException, SQLException {

Review comment:
   getTableInfo() is throwing SQLException which is called from 
getCarbonTable().





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [carbondata] nihal0107 commented on a change in pull request #3878: [CARBONDATA-3947]Fixed Hive read/write operation for Insert into Select operation.

2020-08-11 Thread GitBox


nihal0107 commented on a change in pull request #3878:
URL: https://github.com/apache/carbondata/pull/3878#discussion_r468359293



##
File path: 
integration/hive/src/main/java/org/apache/carbondata/hive/util/HiveCarbonUtil.java
##
@@ -155,7 +155,7 @@ public static CarbonLoadModel getCarbonLoadModel(String 
tableName, String databa
 return loadModel;
   }
 
-  private static TableInfo getTableInfo(String tableName, String databaseName, 
String location,
+  public static TableInfo getTableInfo(String tableName, String databaseName, 
String location,

Review comment:
   done





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org