Examples of HiveVarchar


Examples of org.apache.hadoop.hive.common.type.HiveVarchar

        .startNot()
           .startOr()
             .isNull("x")
             .between("y", HiveDecimal.create(10), 20.0)
             .in("z", (byte)1, (short)2, (int)3)
             .nullSafeEquals("a", new HiveVarchar("stinger", 100))
           .end()
        .end()
        .build();
    assertEquals("leaf-0 = (IS_NULL x)\n" +
        "leaf-1 = (BETWEEN y 10 20.0)\n" +
View Full Code Here

Examples of org.apache.hadoop.hive.common.type.HiveVarchar

  @Test
  public void testVarchar() throws HiveException {
    GenericUDFOPNegative udf = new GenericUDFOPNegative();

    HiveVarchar vc = new HiveVarchar("32300.004747", 12);
    HiveVarcharWritable input = new HiveVarcharWritable(vc);
    VarcharTypeInfo inputTypeInfo = TypeInfoFactory.getVarcharTypeInfo(12);
    ObjectInspector[] inputOIs = {
        PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(inputTypeInfo),
    };
View Full Code Here

Examples of org.apache.hadoop.hive.common.type.HiveVarchar

  @Test
  public void testVarchar() throws HiveException {
    GenericUDFCeil udf = new GenericUDFCeil();

    HiveVarchar vc = new HiveVarchar("32300.004747", 12);
    HiveVarcharWritable input = new HiveVarcharWritable(vc);
    VarcharTypeInfo inputTypeInfo = TypeInfoFactory.getVarcharTypeInfo(12);
    ObjectInspector[] inputOIs = {
        PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(inputTypeInfo),
    };
View Full Code Here

Examples of org.apache.hadoop.hive.common.type.HiveVarchar

  @Test
  public void testVarchar() throws HiveException {
    GenericUDFOPPositive udf = new GenericUDFOPPositive();

    HiveVarchar vc = new HiveVarchar("32300.004747", 12);
    HiveVarcharWritable input = new HiveVarcharWritable(vc);
    VarcharTypeInfo inputTypeInfo = TypeInfoFactory.getVarcharTypeInfo(12);
    ObjectInspector[] inputOIs = {
        PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(inputTypeInfo),
    };
View Full Code Here

Examples of org.apache.hadoop.hive.common.type.HiveVarchar

  private Writable getWritableValue(TypeInfo ti, byte[] value) {
    if (ti.equals(TypeInfoFactory.stringTypeInfo)) {
      return new Text(value);
    } else if (ti.equals(TypeInfoFactory.varcharTypeInfo)) {
      return new HiveVarcharWritable(
          new HiveVarchar(new Text(value).toString(), -1));
    } else if (ti.equals(TypeInfoFactory.binaryTypeInfo)) {
      return new BytesWritable(value);
    }
    return null;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.common.type.HiveVarchar

      }
     
      @Override
      public Object initValue(Object ignored) {
        return ((SettableHiveVarcharObjectInspector) this.objectInspector)
            .create(new HiveVarchar(StringUtils.EMPTY, -1));
      }
    }.init(fieldObjInspector);
  }
View Full Code Here

Examples of org.apache.hadoop.hive.common.type.HiveVarchar

  @Override
  public HiveVarchar getPrimitiveJavaObject(Object o) {
    if (o == null) {
      return null;
    }
    HiveVarchar value = (HiveVarchar) o;
    if (BaseCharUtils.doesPrimitiveMatchTypeParams(value, (VarcharTypeInfo) typeInfo)) {
      return value;
    }
    // value needs to be converted to match the type params (length, etc).
    return getPrimitiveWithParams(value);
View Full Code Here

Examples of org.apache.hadoop.hive.common.type.HiveVarchar

  public Object set(Object o, HiveVarchar value) {
    if (BaseCharUtils.doesPrimitiveMatchTypeParams(value, (VarcharTypeInfo) typeInfo)) {
      return value;
    } else {
      // Otherwise value may be too long, convert to appropriate value based on params
      return new HiveVarchar(value, getMaxLength());
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hive.common.type.HiveVarchar

    }
  }

  @Override
  public Object set(Object o, String value) {
    return new HiveVarchar(value, getMaxLength());
  }
View Full Code Here

Examples of org.apache.hadoop.hive.common.type.HiveVarchar

    return new HiveVarchar(value, getMaxLength());
  }

  @Override
  public Object create(HiveVarchar value) {
    return new HiveVarchar(value, getMaxLength());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.