Skip to content

Commit

Permalink
Cleaned Thrift Files
Browse files Browse the repository at this point in the history
  • Loading branch information
Vimal-Das committed May 20, 2016
1 parent bcf7609 commit bfdbfa8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 348 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.ArrayList;
import java.util.List;

import org.carbondata.core.carbon.metadata.datatype.ConvertedType;
import org.carbondata.core.carbon.metadata.datatype.DataType;
import org.carbondata.core.carbon.metadata.encoder.Encoding;
import org.carbondata.core.carbon.metadata.schema.SchemaEvolution;
Expand Down Expand Up @@ -77,65 +76,6 @@ public org.carbondata.format.SchemaEvolutionEntry fromWrapperToExternalSchemaEvo
return new org.carbondata.format.SchemaEvolution(thriftSchemaEvolEntryList);
}

/**
* converts wrapper to external converter type
*
* @param convertedType
* @return
*/
private org.carbondata.format.ConvertedType fromWrapperToExternalConvertedType(
ConvertedType convertedType) {

if (null == convertedType) {
return null;
}
switch (convertedType) {
case UTF8:
return org.carbondata.format.ConvertedType.UTF8;
case MAP:
return org.carbondata.format.ConvertedType.MAP;
case MAP_KEY_VALUE:
return org.carbondata.format.ConvertedType.MAP_KEY_VALUE;
case LIST:
return org.carbondata.format.ConvertedType.LIST;
case ENUM:
return org.carbondata.format.ConvertedType.ENUM;
case DECIMAL:
return org.carbondata.format.ConvertedType.DECIMAL;
case DATE:
return org.carbondata.format.ConvertedType.DATE;
case TIME_MILLIS:
return org.carbondata.format.ConvertedType.TIME_MILLIS;
case TIMESTAMP_MILLIS:
return org.carbondata.format.ConvertedType.TIMESTAMP_MILLIS;
case RESERVED:
return org.carbondata.format.ConvertedType.RESERVED;
case UINT_8:
return org.carbondata.format.ConvertedType.UINT_8;
case UINT_16:
return org.carbondata.format.ConvertedType.UINT_16;
case UINT_32:
return org.carbondata.format.ConvertedType.UINT_32;
case UINT_64:
return org.carbondata.format.ConvertedType.UINT_64;
case INT_8:
return org.carbondata.format.ConvertedType.INT_8;
case INT_16:
return org.carbondata.format.ConvertedType.INT_16;
case INT_32:
return org.carbondata.format.ConvertedType.INT_32;
case INT_64:
return org.carbondata.format.ConvertedType.INT_64;
case JSON:
return org.carbondata.format.ConvertedType.JSON;
case BSON:
return org.carbondata.format.ConvertedType.BSON;
case INTERVAL:
return org.carbondata.format.ConvertedType.INTERVAL;
default:
return org.carbondata.format.ConvertedType.UTF8;
}
}

/**
* converts from wrapper to external encoding
Expand Down Expand Up @@ -212,8 +152,6 @@ private org.carbondata.format.DataType fromWrapperToExternalDataType(DataType da
fromWrapperToExternalDataType(wrapperColumnSchema.getDataType()),
wrapperColumnSchema.getColumnName(), wrapperColumnSchema.getColumnUniqueId(),
wrapperColumnSchema.isColumnar(), encoders, wrapperColumnSchema.isDimensionColumn());
thriftColumnSchema.setConverted_type(
fromWrapperToExternalConvertedType(wrapperColumnSchema.getConvertedType()));
thriftColumnSchema.setColumn_group_id(wrapperColumnSchema.getColumnGroupId());
thriftColumnSchema.setScale(wrapperColumnSchema.getScale());
thriftColumnSchema.setPrecision(wrapperColumnSchema.getPrecision());
Expand Down Expand Up @@ -359,65 +297,6 @@ private DataType fromExternalToWrapperDataType(org.carbondata.format.DataType da
}
}

/**
* convert from external to wrapper converter type
*
* @param convertedType
* @return
*/
private ConvertedType fromExternalToWrapperConvertedType(
org.carbondata.format.ConvertedType convertedType) {
if (null == convertedType) {
return null;
}
switch (convertedType) {
case UTF8:
return ConvertedType.UTF8;
case MAP:
return ConvertedType.MAP;
case MAP_KEY_VALUE:
return ConvertedType.MAP_KEY_VALUE;
case LIST:
return ConvertedType.LIST;
case ENUM:
return ConvertedType.ENUM;
case DECIMAL:
return ConvertedType.DECIMAL;
case DATE:
return ConvertedType.DATE;
case TIME_MILLIS:
return ConvertedType.TIME_MILLIS;
case TIMESTAMP_MILLIS:
return ConvertedType.TIMESTAMP_MILLIS;
case RESERVED:
return ConvertedType.RESERVED;
case UINT_8:
return ConvertedType.UINT_8;
case UINT_16:
return ConvertedType.UINT_16;
case UINT_32:
return ConvertedType.UINT_32;
case UINT_64:
return ConvertedType.UINT_64;
case INT_8:
return ConvertedType.INT_8;
case INT_16:
return ConvertedType.INT_16;
case INT_32:
return ConvertedType.INT_32;
case INT_64:
return ConvertedType.INT_64;
case JSON:
return ConvertedType.JSON;
case BSON:
return ConvertedType.BSON;
case INTERVAL:
return ConvertedType.INTERVAL;
default:
return ConvertedType.UTF8;
}
}

/* (non-Javadoc)
* convert from external to wrapper columnschema
*/
Expand All @@ -434,8 +313,6 @@ private ConvertedType fromExternalToWrapperConvertedType(
encoders.add(fromExternalToWrapperEncoding(encoder));
}
wrapperColumnSchema.setEncodingList(encoders);
wrapperColumnSchema.setConvertedType(
fromExternalToWrapperConvertedType(externalColumnSchema.getConverted_type()));
wrapperColumnSchema.setNumberOfChild(externalColumnSchema.getNum_child());
wrapperColumnSchema.setPrecision(externalColumnSchema.getPrecision());
wrapperColumnSchema.setColumnGroup(externalColumnSchema.getColumn_group_id());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.io.Serializable;
import java.util.List;

import org.carbondata.core.carbon.metadata.datatype.ConvertedType;
import org.carbondata.core.carbon.metadata.datatype.DataType;
import org.carbondata.core.carbon.metadata.encoder.Encoding;

Expand Down Expand Up @@ -54,13 +53,6 @@ public CarbonColumn(ColumnSchema columnSchema, int ordinal) {
this.ordinal = ordinal;
}

/**
* @return convertedType
*/
public ConvertedType getConvertedType() {
return columnSchema.getConvertedType();
}

/**
* @return columnar or row based
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.io.Serializable;
import java.util.List;

import org.carbondata.core.carbon.metadata.datatype.ConvertedType;
import org.carbondata.core.carbon.metadata.datatype.DataType;
import org.carbondata.core.carbon.metadata.encoder.Encoding;

Expand Down Expand Up @@ -75,12 +74,6 @@ public class ColumnSchema implements Serializable {
*/
private int columnGroupId = -1;

/**
* Optional When the schema is the result of a conversion from another model
* Used to record the original type to help with cross conversion.
*/
private ConvertedType convertedType;

/**
* Used when this column contains decimal data.
*/
Expand Down Expand Up @@ -176,20 +169,6 @@ public void setColumnGroup(int columnGroupId) {
this.columnGroupId = columnGroupId;
}

/**
* @return the convertedType
*/
public ConvertedType getConvertedType() {
return convertedType;
}

/**
* @param convertedType the convertedType to set
*/
public void setConvertedType(ConvertedType convertedType) {
this.convertedType = convertedType;
}

/**
* @return the scale
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.carbondata.core.carbon.metadata.blocklet.index.BlockletIndex;
import org.carbondata.core.carbon.metadata.blocklet.index.BlockletMinMaxIndex;
import org.carbondata.core.carbon.metadata.blocklet.sort.SortState;
import org.carbondata.core.carbon.metadata.datatype.ConvertedType;
import org.carbondata.core.carbon.metadata.datatype.DataType;
import org.carbondata.core.carbon.metadata.encoder.Encoding;
import org.carbondata.core.carbon.metadata.schema.table.column.ColumnSchema;
Expand Down Expand Up @@ -162,8 +161,6 @@ private ColumnSchema thriftColumnSchmeaToWrapperColumnSchema(
encoders.add(fromExternalToWrapperEncoding(encoder));
}
wrapperColumnSchema.setEncodingList(encoders);
wrapperColumnSchema.setConvertedType(thriftConvertedTypeToWrapperConvertedTypeConverter(
externalColumnSchema.getConverted_type()));
wrapperColumnSchema.setNumberOfChild(externalColumnSchema.getNum_child());
wrapperColumnSchema.setPrecision(externalColumnSchema.getPrecision());
wrapperColumnSchema.setColumnGroup(externalColumnSchema.getColumn_group_id());
Expand Down Expand Up @@ -323,66 +320,6 @@ private DataType thriftDataTyopeToWrapperDataType(org.carbondata.format.DataType
}
}

/**
* Below method is to convert the thrift converted type to wrapper converted
* type
*
* @param convertedType thrift
* @return wrapper converted type
*/
private ConvertedType thriftConvertedTypeToWrapperConvertedTypeConverter(
org.carbondata.format.ConvertedType convertedType) {
if (null == convertedType) {
return null;
}
switch (convertedType) {
case UTF8:
return ConvertedType.UTF8;
case MAP:
return ConvertedType.MAP;
case MAP_KEY_VALUE:
return ConvertedType.MAP_KEY_VALUE;
case LIST:
return ConvertedType.LIST;
case ENUM:
return ConvertedType.ENUM;
case DECIMAL:
return ConvertedType.DECIMAL;
case DATE:
return ConvertedType.DATE;
case TIME_MILLIS:
return ConvertedType.TIME_MILLIS;
case TIMESTAMP_MILLIS:
return ConvertedType.TIMESTAMP_MILLIS;
case RESERVED:
return ConvertedType.RESERVED;
case UINT_8:
return ConvertedType.UINT_8;
case UINT_16:
return ConvertedType.UINT_16;
case UINT_32:
return ConvertedType.UINT_32;
case UINT_64:
return ConvertedType.UINT_64;
case INT_8:
return ConvertedType.INT_8;
case INT_16:
return ConvertedType.INT_16;
case INT_32:
return ConvertedType.INT_32;
case INT_64:
return ConvertedType.INT_64;
case JSON:
return ConvertedType.JSON;
case BSON:
return ConvertedType.BSON;
case INTERVAL:
return ConvertedType.INTERVAL;
default:
return ConvertedType.UTF8;
}
}

/**
* Below method will be used to convert the thrift presence meta to wrapper
* presence meta
Expand Down
Loading

0 comments on commit bfdbfa8

Please sign in to comment.