org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe.initialize()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe.initialize()方法的一些代码示例,展示了LazySimpleSerDe.initialize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LazySimpleSerDe.initialize()方法的具体详情如下:
包路径:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
类名称:LazySimpleSerDe
方法名:initialize

LazySimpleSerDe.initialize介绍

[英]Initialize the SerDe given the parameters. serialization.format: separator char or byte code (only supports byte-value up to 127) columns: ","-separated column names columns.types: ",", ":", or ";"-separated column types
[中]在给定参数的情况下初始化SerDe。序列化。格式:分隔符字符或字节码(仅支持最多127个字节值)列:“,”-分隔的列名列。类型:“,”:“,或”-分离列类型

代码示例

代码示例来源:origin: klout/brickhouse

private LazySimpleSerDe getLineSerde() throws SerDeException {
  if (serde == null) {
    Logger.getLogger(LazySimpleSerDe.class).setLevel(Level.DEBUG);
    serde = new LazySimpleSerDe();
    Configuration job = new Configuration();
    Properties tbl = new Properties();
    tbl.setProperty("columns", "key,value");
    tbl.setProperty("columns.types", keyType.getTypeName() + "," + valType.getTypeName());
    serde.initialize(job, tbl);
  }
  return serde;
}

代码示例来源:origin: io.github.myui/hivemall

public static LazySimpleSerDe getKeyValueLineSerde(@Nonnull final PrimitiveObjectInspector keyOI, @Nonnull final PrimitiveObjectInspector valueOI)
    throws SerDeException {
  LazySimpleSerDe serde = new LazySimpleSerDe();
  Configuration conf = new Configuration();
  Properties tbl = new Properties();
  tbl.setProperty("columns", "key,value");
  tbl.setProperty("columns.types", keyOI.getTypeName() + "," + valueOI.getTypeName());
  serde.initialize(conf, tbl);
  return serde;
}

代码示例来源:origin: io.github.myui/hivemall-core

public static LazySimpleSerDe getKeyValueLineSerde(
    @Nonnull final PrimitiveObjectInspector keyOI,
    @Nonnull final PrimitiveObjectInspector valueOI) throws SerDeException {
  LazySimpleSerDe serde = new LazySimpleSerDe();
  Configuration conf = new Configuration();
  Properties tbl = new Properties();
  tbl.setProperty("columns", "key,value");
  tbl.setProperty("columns.types", keyOI.getTypeName() + "," + valueOI.getTypeName());
  serde.initialize(conf, tbl);
  return serde;
}

代码示例来源:origin: org.apache.hivemall/hivemall-core

public static LazySimpleSerDe getKeyValueLineSerde(
    @Nonnull final PrimitiveObjectInspector keyOI,
    @Nonnull final PrimitiveObjectInspector valueOI) throws SerDeException {
  LazySimpleSerDe serde = new LazySimpleSerDe();
  Configuration conf = new Configuration();
  Properties tbl = new Properties();
  tbl.setProperty("columns", "key,value");
  tbl.setProperty("columns.types", keyOI.getTypeName() + "," + valueOI.getTypeName());
  serde.initialize(conf, tbl);
  return serde;
}

代码示例来源:origin: io.github.myui/hivemall

public static LazySimpleSerDe getLineSerde(@Nonnull final PrimitiveObjectInspector... OIs)
      throws SerDeException {
    if(OIs.length == 0) {
      throw new IllegalArgumentException("OIs must be specified");
    }
    LazySimpleSerDe serde = new LazySimpleSerDe();
    Configuration conf = new Configuration();
    Properties tbl = new Properties();

    StringBuilder columnNames = new StringBuilder();
    StringBuilder columnTypes = new StringBuilder();
    for(int i = 0; i < OIs.length; i++) {
      columnNames.append('c').append(i + 1).append(',');
      columnTypes.append(OIs[i].getTypeName()).append(',');
    }
    columnNames.deleteCharAt(columnNames.length() - 1);
    columnTypes.deleteCharAt(columnTypes.length() - 1);

    tbl.setProperty("columns", columnNames.toString());
    tbl.setProperty("columns.types", columnTypes.toString());
    serde.initialize(conf, tbl);
    return serde;
  }
}

代码示例来源:origin: org.apache.hivemall/hivemall-core

public static LazySimpleSerDe getLineSerde(@Nonnull final PrimitiveObjectInspector... OIs)
    throws SerDeException {
  if (OIs.length == 0) {
    throw new IllegalArgumentException("OIs must be specified");
  }
  LazySimpleSerDe serde = new LazySimpleSerDe();
  Configuration conf = new Configuration();
  Properties tbl = new Properties();
  StringBuilder columnNames = new StringBuilder();
  StringBuilder columnTypes = new StringBuilder();
  for (int i = 0; i < OIs.length; i++) {
    columnNames.append('c').append(i + 1).append(',');
    columnTypes.append(OIs[i].getTypeName()).append(',');
  }
  columnNames.deleteCharAt(columnNames.length() - 1);
  columnTypes.deleteCharAt(columnTypes.length() - 1);
  tbl.setProperty("columns", columnNames.toString());
  tbl.setProperty("columns.types", columnTypes.toString());
  serde.initialize(conf, tbl);
  return serde;
}

代码示例来源:origin: io.github.myui/hivemall-core

public static LazySimpleSerDe getLineSerde(@Nonnull final PrimitiveObjectInspector... OIs)
      throws SerDeException {
    if (OIs.length == 0) {
      throw new IllegalArgumentException("OIs must be specified");
    }
    LazySimpleSerDe serde = new LazySimpleSerDe();
    Configuration conf = new Configuration();
    Properties tbl = new Properties();

    StringBuilder columnNames = new StringBuilder();
    StringBuilder columnTypes = new StringBuilder();
    for (int i = 0; i < OIs.length; i++) {
      columnNames.append('c').append(i + 1).append(',');
      columnTypes.append(OIs[i].getTypeName()).append(',');
    }
    columnNames.deleteCharAt(columnNames.length() - 1);
    columnTypes.deleteCharAt(columnTypes.length() - 1);

    tbl.setProperty("columns", columnNames.toString());
    tbl.setProperty("columns.types", columnTypes.toString());
    serde.initialize(conf, tbl);
    return serde;
  }
}

相关文章