use of org.apache.carbondata.core.metadata.encoder.Encoding in project carbondata by apache.
the class ThriftWrapperSchemaConverterImplTest method testFromWrapperToExternalColumnSchemaForDatatypeNullCase.
@Test
public void testFromWrapperToExternalColumnSchemaForDatatypeNullCase() {
org.apache.carbondata.format.ColumnSchema thriftColumnSchema = new org.apache.carbondata.format.ColumnSchema(null, "columnName", "1", true, encoders, true);
thriftColumnSchema.setSchemaOrdinal(1);
new MockUp<ColumnSchema>() {
@Mock
public List<Encoding> getEncodingList() {
return encodings;
}
@Mock
public int getSchemaOrdinal() {
return 1;
}
@Mock
public DataType getDataType() {
return null;
}
@Mock
public String getColumnName() {
return "columnName";
}
@Mock
public String getColumnUniqueId() {
return "1";
}
@Mock
public boolean isColumnar() {
return true;
}
@Mock
public boolean isDimensionColumn() {
return true;
}
@Mock
public int getColumnGroupId() {
return 1;
}
@Mock
public int getScale() {
return 1;
}
@Mock
public int getPrecision() {
return 1;
}
@Mock
public int getNumberOfChild() {
return 1;
}
@Mock
public byte[] getDefaultValue() {
return new byte[] { 1, 2 };
}
@Mock
public Map<String, String> getColumnProperties() {
return columnPropertyMap;
}
@Mock
public boolean isInvisible() {
return true;
}
@Mock
public String getColumnReferenceId() {
return "1";
}
};
ColumnSchema wrapperColumnSchema = new ColumnSchema();
org.apache.carbondata.format.ColumnSchema actualResult = thriftWrapperSchemaConverter.fromWrapperToExternalColumnSchema(wrapperColumnSchema);
assertEquals(thriftColumnSchema, actualResult);
}
use of org.apache.carbondata.core.metadata.encoder.Encoding in project carbondata by apache.
the class SegmentPropertiesTestUtil method getMeasureColumn.
public static ColumnSchema getMeasureColumn() {
ColumnSchema dimColumn = new ColumnSchema();
dimColumn.setColumnName("IMEI_COUNT");
dimColumn.setColumnUniqueId(UUID.randomUUID().toString());
dimColumn.setDataType(DataType.STRING);
List<Encoding> encodeList = new ArrayList<Encoding>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
encodeList.add(Encoding.DELTA);
dimColumn.setEncodingList(encodeList);
return dimColumn;
}
use of org.apache.carbondata.core.metadata.encoder.Encoding in project carbondata by apache.
the class SegmentPropertiesTestUtil method getMeasureColumn1.
public static ColumnSchema getMeasureColumn1() {
ColumnSchema dimColumn = new ColumnSchema();
dimColumn.setColumnName("IMEI_COUNT1");
dimColumn.setColumnUniqueId(UUID.randomUUID().toString());
dimColumn.setDataType(DataType.STRING);
List<Encoding> encodeList = new ArrayList<Encoding>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
encodeList.add(Encoding.DELTA);
dimColumn.setEncodingList(encodeList);
return dimColumn;
}
use of org.apache.carbondata.core.metadata.encoder.Encoding in project carbondata by apache.
the class SegmentPropertiesTestUtil method getDimensionColumn9.
public static ColumnSchema getDimensionColumn9() {
ColumnSchema dimColumn = new ColumnSchema();
dimColumn.setColumnar(false);
dimColumn.setColumnName("IMEI9");
dimColumn.setColumnUniqueId(UUID.randomUUID().toString());
dimColumn.setDataType(DataType.STRING);
dimColumn.setDimensionColumn(true);
List<Encoding> encodeList = new ArrayList<Encoding>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
encodeList.add(Encoding.DICTIONARY);
dimColumn.setEncodingList(encodeList);
dimColumn.setColumnGroup(1);
dimColumn.setNumberOfChild(0);
return dimColumn;
}
use of org.apache.carbondata.core.metadata.encoder.Encoding in project carbondata by apache.
the class SegmentPropertiesTest method getDimensionColumn4.
private ColumnSchema getDimensionColumn4() {
ColumnSchema dimColumn = new ColumnSchema();
dimColumn.setColumnar(false);
dimColumn.setColumnName("IMEI3");
dimColumn.setColumnUniqueId(UUID.randomUUID().toString());
dimColumn.setDataType(DataType.STRING);
dimColumn.setDimensionColumn(true);
List<Encoding> encodeList = new ArrayList<Encoding>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
encodeList.add(Encoding.DICTIONARY);
dimColumn.setEncodingList(encodeList);
dimColumn.setNumberOfChild(0);
dimColumn.setColumnGroup(0);
return dimColumn;
}
Aggregations