|
21 | 21 | import java.util.ArrayList;
|
22 | 22 | import java.util.Arrays;
|
23 | 23 | import java.util.HashMap;
|
24 |
| -import java.util.HashSet; |
25 | 24 | import java.util.List;
|
26 | 25 | import java.util.Map;
|
27 | 26 | import java.util.Objects;
|
28 |
| -import java.util.Set; |
29 | 27 | import java.util.concurrent.ConcurrentHashMap;
|
30 | 28 | import java.util.concurrent.atomic.AtomicReference;
|
31 | 29 | import java.util.stream.Collectors;
|
32 | 30 |
|
33 | 31 | import org.apache.carbondata.common.logging.LogServiceFactory;
|
| 32 | +import org.apache.carbondata.core.catalog.BaseCatalog; |
| 33 | +import org.apache.carbondata.core.catalog.CatalogFactory; |
34 | 34 | import org.apache.carbondata.core.constants.CarbonCommonConstants;
|
35 | 35 | import org.apache.carbondata.core.datastore.filesystem.CarbonFile;
|
36 | 36 | import org.apache.carbondata.core.datastore.impl.FileFactory;
|
|
40 | 40 | import org.apache.carbondata.core.indexstore.PartitionSpec;
|
41 | 41 | import org.apache.carbondata.core.metadata.AbsoluteTableIdentifier;
|
42 | 42 | import org.apache.carbondata.core.metadata.CarbonMetadata;
|
43 |
| -import org.apache.carbondata.core.metadata.SegmentFileStore; |
44 | 43 | import org.apache.carbondata.core.metadata.converter.SchemaConverter;
|
45 | 44 | import org.apache.carbondata.core.metadata.converter.ThriftWrapperSchemaConverterImpl;
|
46 | 45 | import org.apache.carbondata.core.metadata.index.IndexType;
|
47 | 46 | import org.apache.carbondata.core.metadata.schema.indextable.IndexMetadata;
|
48 | 47 | import org.apache.carbondata.core.metadata.schema.indextable.IndexTableInfo;
|
49 | 48 | import org.apache.carbondata.core.metadata.schema.table.CarbonTable;
|
50 | 49 | import org.apache.carbondata.core.metadata.schema.table.TableInfo;
|
51 |
| -import org.apache.carbondata.core.reader.ThriftReader; |
52 | 50 | import org.apache.carbondata.core.scan.expression.Expression;
|
53 | 51 | import org.apache.carbondata.core.statusmanager.FileFormat;
|
54 |
| -import org.apache.carbondata.core.statusmanager.LoadMetadataDetails; |
55 | 52 | import org.apache.carbondata.core.util.CarbonProperties;
|
56 | 53 | import org.apache.carbondata.core.util.CarbonUtil;
|
57 | 54 | import org.apache.carbondata.core.util.path.CarbonTablePath;
|
58 | 55 | import org.apache.carbondata.hadoop.CarbonInputSplit;
|
59 | 56 | import org.apache.carbondata.hadoop.api.CarbonInputFormat;
|
60 | 57 | import org.apache.carbondata.hadoop.api.CarbonTableInputFormat;
|
61 |
| -import org.apache.carbondata.presto.PrestoFilterUtil; |
62 | 58 |
|
63 | 59 | import com.google.gson.Gson;
|
64 | 60 | import com.google.inject.Inject;
|
65 |
| -import io.prestosql.plugin.hive.HiveColumnHandle; |
66 | 61 | import io.prestosql.spi.connector.SchemaTableName;
|
67 |
| -import io.prestosql.spi.predicate.TupleDomain; |
68 |
| -import org.apache.commons.collections.CollectionUtils; |
69 | 62 | import org.apache.hadoop.conf.Configuration;
|
70 | 63 | import org.apache.hadoop.mapred.JobConf;
|
71 | 64 | import org.apache.hadoop.mapreduce.InputSplit;
|
72 | 65 | import org.apache.hadoop.mapreduce.Job;
|
73 | 66 | import org.apache.log4j.Logger;
|
74 |
| -import org.apache.thrift.TBase; |
75 | 67 |
|
76 | 68 | import static org.apache.hadoop.fs.s3a.Constants.ACCESS_KEY;
|
77 | 69 | import static org.apache.hadoop.fs.s3a.Constants.ENDPOINT;
|
@@ -192,20 +184,7 @@ private CarbonTableCacheModel parseCarbonMetadata(SchemaTableName table, String
|
192 | 184 | org.apache.carbondata.format.TableInfo tableInfo;
|
193 | 185 | long modifiedTime = System.currentTimeMillis();
|
194 | 186 | if (isTransactionalTable) {
|
195 |
| - //Step 2: read the metadata (tableInfo) of the table. |
196 |
| - ThriftReader.TBaseCreator createTBase = new ThriftReader.TBaseCreator() { |
197 |
| - // TBase is used to read and write thrift objects. |
198 |
| - // TableInfo is a kind of TBase used to read and write table information. |
199 |
| - // TableInfo is generated by thrift, |
200 |
| - // see schema.thrift under format/src/main/thrift for details. |
201 |
| - public TBase create() { |
202 |
| - return new org.apache.carbondata.format.TableInfo(); |
203 |
| - } |
204 |
| - }; |
205 |
| - ThriftReader thriftReader = new ThriftReader(schemaFilePath, createTBase, config); |
206 |
| - thriftReader.open(); |
207 |
| - tableInfo = (org.apache.carbondata.format.TableInfo) thriftReader.read(); |
208 |
| - thriftReader.close(); |
| 187 | + tableInfo = CatalogFactory.getInstance().getCatalog().getSchema(schemaFilePath); |
209 | 188 | modifiedTime = schemaFile.getLastModifiedTime();
|
210 | 189 | } else {
|
211 | 190 | tableInfo = CarbonUtil.inferSchema(tablePath, table.getTableName(), false, config);
|
|
0 commit comments