@Override public JsonElement serialize( PartitionMethodDescExpr src, Type typeOfSrc, JsonSerializationContext context) { switch (src.getPartitionType()) { case RANGE: return context.serialize(src, RangePartition.class); case HASH: return context.serialize(src, HashPartition.class); case LIST: return context.serialize(src, ListPartition.class); case COLUMN: return context.serialize(src, ColumnPartition.class); default: return null; } }
@Override public Object clone() throws CloneNotSupportedException { CreateTable createTable = (CreateTable) super.clone(); createTable.external = external; createTable.tableName = tableName; if (tableElements != null) { createTable.tableElements = new ColumnDefinition[tableElements.length]; for (int i = 0; i < tableElements.length; i++) { createTable.tableElements[i] = (ColumnDefinition) tableElements[i].clone(); } } createTable.storageType = storageType; createTable.location = location; createTable.subquery = subquery; if (params != null) { createTable.params = new HashMap<>(params); } if (partition != null) { createTable.partition = (PartitionMethodDescExpr) partition.clone(); } createTable.ifNotExists = ifNotExists; return createTable; }
@Override public Object clone() throws CloneNotSupportedException { PartitionMethodDescExpr partition = (PartitionMethodDescExpr) super.clone(); partition.type = type; return partition; }