public int getPartitionKey(IScalar partitionCol) { if (partitionCol.getDataCategory() != cat) { throw new Exception("Data category incompatible."); } if (cat == DATA_CATEGORY.TEMPORAL && type != partitionCol.getDataType()) { DATA_TYPE old = partitionCol.getDataType(); partitionCol = (IScalar)Utils.castDateTime(partitionCol, type); if (partitionCol == null) { throw new Exception("Can't convert type from " + old.ToString() + " to " + type.ToString()); } } int index = 0; if (dict.ContainsKey(partitionCol)) { index = (int)dict[partitionCol]; } else { index = -1; } return(index); }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_FLOAT) { setFloat(index, ((BasicFloat)value).getValue()); } }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_SECOND) { setSecond(index, ((BasicSecond)value).getValue()); } }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_DOUBLE) { setDouble(index, ((BasicDouble)value).getValue()); } }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_MONTH) { setMonth(index, ((BasicMonth)value).getValue()); } }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_DATETIME) { setDateTime(index, ((BasicDateTime)value).getValue()); } }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_NANOTIMESTAMP) { setNanoTimestamp(index, ((BasicNanoTimestamp)value).getValue()); } }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_SHORT) { setShort(index, ((BasicShort)value).getValue()); } }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_STRING) { values[index] = ((BasicString)value).getString(); } }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_MINUTE) { setMinute(index, ((BasicMinute)value).getValue()); } }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_SHORT) { setShort(index, ((BasicShort)value).getValue()); } else { throw new Exception("The value must be a short scalar. "); } }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_NANOTIMESTAMP) { setNanoTimestamp(index, ((BasicNanoTimestamp)value).getValue()); } else { throw new Exception("The value must be a nanoTimeStamp scalar. "); } }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_SECOND) { setSecond(index, ((BasicSecond)value).getValue()); } else { throw new Exception("The value must be a second scalar. "); } }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_INT) { values[index] = ((BasicInt)value).getInt(); } else { values[index] = Convert.ToInt32(value.getString()); } }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_FLOAT) { setFloat(index, ((BasicFloat)value).getValue()); } else { throw new Exception("The value must be a float scalar. "); } }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_MINUTE) { setMinute(index, ((BasicMinute)value).getValue()); } else { throw new Exception("The value must be a minute scalar. "); } }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_STRING) { values[index] = @base.find(value.getString(), true); } else { throw new Exception("The value must be a string scalar. "); } }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_MONTH) { setMonth(index, ((BasicMonth)value).getValue()); } else { throw new Exception("The value must be a month scalar. "); } }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_DATETIME) { setDateTime(index, ((BasicDateTime)value).getValue()); } else { throw new Exception("The value must be a dateTime scalar. "); } }
public int getPartitionKey(IScalar partitionCol) { if (partitionCol.getDataCategory() != cat) { throw new Exception("Data category incompatible."); } if (cat == DATA_CATEGORY.TEMPORAL && type != partitionCol.getDataType()) { //类型转化 DATA_TYPE old = partitionCol.getDataType(); partitionCol = (IScalar)Utils.castDateTime(partitionCol, type); if (partitionCol == null) { throw new Exception("Can't convert type from " + old.ToString() + " to " + type.ToString()); } } int rows = partitionCol.rows(); int key = partitionCol.hashBucket(buckets); return(key); }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_UUID) { Long2 t = ((BasicInt128)value).getLong2(); setInt128(index, t.high, t.low); } else { throw new Exception("The value must be a uuid scalar. "); } }
public virtual bool put(IScalar key, IEntity value) { if (key.getDataType() != KeyDataType || (value.getDataType() != getDataType())) { return(false); } else { dict[key] = value; return(true); } }
public override void set(int index, IScalar value) { if (value.getDataType() == DATA_TYPE.DT_INT128) { values[index].high = ((BasicInt128)value).getMostSignicantBits(); values[index].low = ((BasicInt128)value).getLeastSignicantBits(); } else { throw new Exception("The value must be a int128 scalar. "); } }
public int getPartitionKey(IScalar partitionCol) { if (partitionCol.getDataCategory() != cat) { throw new Exception("Data category incompatible."); } if (cat == DATA_CATEGORY.TEMPORAL && type != partitionCol.getDataType()) { DATA_TYPE old = partitionCol.getDataType(); partitionCol = (IScalar)Utils.castDateTime(partitionCol, type); if (partitionCol == null) { throw new Exception("Can't convert type from " + old.ToString() + " to " + type.ToString()); } } if (type == DATA_TYPE.DT_LONG) { throw new Exception("Long type value can't be used as a partition column."); } int key = partitionCol.hashBucket(1048576); return(key); }
public int getPartitionKey(IScalar partitionCol) { if (partitionCol.getDataCategory() != cat) { throw new Exception("Data category incompatible."); } if (cat == DATA_CATEGORY.TEMPORAL && type != partitionCol.getDataType()) { DATA_TYPE old = partitionCol.getDataType(); partitionCol = (IScalar)Utils.castDateTime(partitionCol, type); if (partitionCol == null) { throw new Exception("Can't convert type from " + old.ToString() + " to " + type.ToString()); } } int partitions = range.rows() - 1; int key = range.asof(partitionCol); if (key >= partitions) { key = -1; } return(key); }