@Override public org.apache.carbondata.format.TableInfo fromWrapperToExternalTableInfo( TableInfo wrapperTableInfo, String dbName, String tableName) { org.apache.carbondata.format.TableSchema thriftFactTable = fromWrapperToExternalTableSchema(wrapperTableInfo.getFactTable()); org.apache.carbondata.format.TableInfo tableInfo = new org.apache.carbondata.format.TableInfo(thriftFactTable, new ArrayList<org.apache.carbondata.format.TableSchema>()); List<DataMapSchema> wrapperChildSchemaList = wrapperTableInfo.getDataMapSchemaList(); if (null != wrapperChildSchemaList) { List<org.apache.carbondata.format.DataMapSchema> thriftChildSchemas = fromWrapperToExternalChildSchemaList(wrapperChildSchemaList); tableInfo.setDataMapSchemas(thriftChildSchemas); } return tableInfo; }
/** * This method will prepare dummy tableInfo * * @param carbonDataFilePath * @param tableName * @return */ public static TableInfo buildDummyTableInfo(String carbonDataFilePath, String tableName, String dbName) { // During SDK carbon Reader, This method will be called. // This API will avoid IO operation to get the columnSchema list. // ColumnSchema list will be filled during blocklet loading (where actual IO happens) List<ColumnSchema> columnSchemaList = new ArrayList<>(); TableSchema tableSchema = getDummyTableSchema(tableName,columnSchemaList); ThriftWrapperSchemaConverterImpl thriftWrapperSchemaConverter = new ThriftWrapperSchemaConverterImpl(); org.apache.carbondata.format.TableSchema thriftFactTable = thriftWrapperSchemaConverter.fromWrapperToExternalTableSchema(tableSchema); org.apache.carbondata.format.TableInfo tableInfo = new org.apache.carbondata.format.TableInfo(thriftFactTable, new ArrayList<org.apache.carbondata.format.TableSchema>()); tableInfo.setDataMapSchemas(null); SchemaConverter schemaConverter = new ThriftWrapperSchemaConverterImpl(); TableInfo wrapperTableInfo = schemaConverter.fromExternalToWrapperTableInfo( tableInfo, dbName, tableName, carbonDataFilePath); wrapperTableInfo.setTransactionalTable(false); return wrapperTableInfo; }
new ArrayList<org.apache.carbondata.format.TableSchema>()); tableInfo.setDataMapSchemas(null); return tableInfo; } finally {
new ArrayList<org.apache.carbondata.format.TableSchema>()); tableInfo.setDataMapSchemas(null); return tableInfo;
public void setFieldValue(_Fields field, Object value) { switch (field) { case FACT_TABLE: if (value == null) { unsetFact_table(); } else { setFact_table((TableSchema)value); } break; case AGGREGATE_TABLE_LIST: if (value == null) { unsetAggregate_table_list(); } else { setAggregate_table_list((List<TableSchema>)value); } break; case DATA_MAP_SCHEMAS: if (value == null) { unsetDataMapSchemas(); } else { setDataMapSchemas((List<DataMapSchema>)value); } break; } }