use of org.apache.carbondata.core.metadata.CarbonTableIdentifier in project carbondata by apache.
the class BlockIndexStoreTest method testLoadAndGetTaskIdToSegmentsMapForSingleSegment.
@Test
public void testLoadAndGetTaskIdToSegmentsMapForSingleSegment() throws IOException {
File file = getPartFile();
TableBlockInfo info = new TableBlockInfo(file.getAbsolutePath(), 0, "0", new String[] { "loclhost" }, file.length(), ColumnarFormatVersion.V1);
CarbonTableIdentifier carbonTableIdentifier = new CarbonTableIdentifier(CarbonCommonConstants.DATABASE_DEFAULT_NAME, "t3", "1");
AbsoluteTableIdentifier absoluteTableIdentifier = new AbsoluteTableIdentifier("/src/test/resources", carbonTableIdentifier);
try {
List<TableBlockUniqueIdentifier> tableBlockInfoList = getTableBlockUniqueIdentifierList(Arrays.asList(new TableBlockInfo[] { info }), absoluteTableIdentifier);
List<AbstractIndex> loadAndGetBlocks = cache.getAll(tableBlockInfoList);
assertTrue(loadAndGetBlocks.size() == 1);
} catch (Exception e) {
assertTrue(false);
}
List<String> segmentIds = new ArrayList<>();
segmentIds.add(info.getSegmentId());
cache.removeTableBlocks(segmentIds, absoluteTableIdentifier);
}
use of org.apache.carbondata.core.metadata.CarbonTableIdentifier in project carbondata by apache.
the class ForwardDictionaryCacheTest method setUp.
@Before
public void setUp() throws Exception {
init();
this.databaseName = props.getProperty("database", "testSchema");
this.tableName = props.getProperty("tableName", "carbon");
this.carbonStorePath = props.getProperty("storePath", "carbonStore");
carbonTableIdentifier = new CarbonTableIdentifier(databaseName, tableName, UUID.randomUUID().toString());
columnIdentifiers = new String[] { "name", "place" };
deleteStorePath();
prepareDataSet();
createDictionaryCacheObject();
}
use of org.apache.carbondata.core.metadata.CarbonTableIdentifier in project carbondata by apache.
the class CarbonTableIdentifierTest method equalsTestWithoutDatabaseName.
@Test
public void equalsTestWithoutDatabaseName() {
CarbonTableIdentifier carbonTableIdentifierTest = new CarbonTableIdentifier(null, "tableName", "tableId");
Boolean res = carbonTableIdentifierTest.equals(carbonTableIdentifier);
assert (!res);
}
use of org.apache.carbondata.core.metadata.CarbonTableIdentifier in project carbondata by apache.
the class ReverseDictionaryCacheTest method setUp.
@Before
public void setUp() throws Exception {
init();
this.databaseName = props.getProperty("database", "testSchema");
this.tableName = props.getProperty("tableName", "carbon");
this.carbonStorePath = props.getProperty("storePath", "carbonStore");
carbonTableIdentifier = new CarbonTableIdentifier(databaseName, tableName, UUID.randomUUID().toString());
columnIdentifiers = new String[] { "name", "place" };
deleteStorePath();
prepareDataSet();
createDictionaryCacheObject();
}
use of org.apache.carbondata.core.metadata.CarbonTableIdentifier in project carbondata by apache.
the class CarbonTableIdentifierTest method equalsTestWithNullTableName.
@Test
public void equalsTestWithNullTableName() {
CarbonTableIdentifier carbonTableIdentifierTest = new CarbonTableIdentifier("DatabseName", null, "tableId");
Boolean res = carbonTableIdentifierTest.equals(carbonTableIdentifier);
assert (!res);
}
Aggregations