Examples of HiveConf


Examples of org.apache.hadoop.hive.conf.HiveConf

    // NOTE: It is critical to do this here so that log4j is reinitialized
    // before any of the other core hive classes are loaded
    SessionState.initHiveLog4j();

    CliSessionState ss = new CliSessionState(new HiveConf(SessionState.class));
    ss.in = System.in;
    try {
      ss.out = new PrintStream(System.out, true, "UTF-8");
      ss.err = new PrintStream(System.err, true, "UTF-8");
    } catch (UnsupportedEncodingException e) {
      System.exit(3);
    }

    if (!oproc.process_stage2(ss)) {
      System.exit(2);
    }

    // set all properties specified via command line
    HiveConf conf = ss.getConf();
    for (Map.Entry<Object, Object> item : ss.cmdProperties.entrySet()) {
      conf.set((String) item.getKey(), (String) item.getValue());
    }

    if (!ShimLoader.getHadoopShims().usesJobShell()) {
      // hadoop-20 and above - we need to augment classpath using hiveconf
      // components
      // see also: code in ExecDriver.java
      ClassLoader loader = conf.getClassLoader();
      String auxJars = HiveConf.getVar(conf, HiveConf.ConfVars.HIVEAUXJARS);
      if (StringUtils.isNotBlank(auxJars)) {
        loader = Utilities.addToClassPath(loader, StringUtils.split(auxJars, ","));
      }
      conf.setClassLoader(loader);
      Thread.currentThread().setContextClassLoader(loader);
    }

    SessionState.start(ss);
View Full Code Here

Examples of org.apache.hadoop.hive.conf.HiveConf

public class JavaAction {

  public static void main(String[] args) throws Exception{

    HiveConf conf = new HiveConf();
    conf.addResource(new Path("file:///", System.getProperty("oozie.action.conf.xml")));
    conf.setVar(ConfVars.SEMANTIC_ANALYZER_HOOK, HowlSemanticAnalyzer.class.getName());
    conf.setBoolVar(ConfVars.METASTORE_USE_THRIFT_SASL, true);
    SessionState.start(new CliSessionState(conf));
    new CliDriver().processLine(args[0]);
  }
View Full Code Here

Examples of org.apache.hadoop.hive.conf.HiveConf

        this.table_schema = table_schema;

        //create basic configuration for hdfs and hive
        conf = new Configuration();
        hiveConf = new HiveConf(conf, SessionState.class);

        //parse the table_schema string
        List<String> types = HiveRCSchemaUtil.parseSchemaTypes(table_schema);
        List<String> cols = HiveRCSchemaUtil.parseSchema(pcols, table_schema);
        List<FieldSchema> fieldschema = null;
View Full Code Here

Examples of org.apache.hadoop.hive.conf.HiveConf

     *
     * @param name - the name of this handler
     */
    public ThriftMetaStoreHandler(String name) {
      super(name);
      conf_ = new HiveConf(ThriftMetaStoreHandler.class);
    }
View Full Code Here

Examples of org.apache.hadoop.hive.conf.HiveConf

   * and configuration parameters.
   * @return the number of reducers.
   */
  public int estimateNumberOfReducers(HiveConf hive, JobConf job, mapredWork work) throws IOException {
    if (hive == null) {
      hive = new HiveConf();
    }
    long bytesPerReducer = hive.getLongVar(HiveConf.ConfVars.BYTESPERREDUCER);
    int maxReducers = hive.getIntVar(HiveConf.ConfVars.MAXREDUCERS);
    long totalInputFileSize = getTotalInputFileSize(job, work);

View Full Code Here

Examples of org.apache.hadoop.hive.conf.HiveConf

  /**
   * TODO: - throw more specific exception
   *       - parse uri (use java.net.URI?)
   */
  public HiveConnection(String uri, Properties info) throws Exception {
    session = new JdbcSessionState(new HiveConf(SessionState.class));
    session.in = null;
    session.out = null;
    session.err = null;
    SessionState.start(session);

View Full Code Here

Examples of org.apache.hadoop.hive.conf.HiveConf

  /**
   * TODO: - throw more specific exception
   *       - parse uri (use java.net.URI?)
   */
  public HiveConnection(String uri, Properties info) throws Exception {
    session = new JdbcSessionState(new HiveConf(SessionState.class));
    session.in = null;
    session.out = null;
    session.err = null;
    SessionState.start(session);

View Full Code Here

Examples of org.apache.hadoop.hive.conf.HiveConf

  private Connection con;
  private boolean standAloneServer = false;

  public TestJdbcDriver(String name) {
    super(name);
    conf = new HiveConf(TestJdbcDriver.class);
    String dataFileDir = conf.get("test.data.files").replace('\\', '/').replace("c:", "");
    dataFilePath = new Path(dataFileDir, "kv1.txt");
    //standAloneServer = System.getProperty("test.service.standalone.server").equals("true");
  }
View Full Code Here

Examples of org.apache.hadoop.hive.conf.HiveConf

  private Path dataFilePath;
  private HWISessionManager hsm;

  public TestHWISessionManager(String name) {
    super(name);
    conf = new HiveConf(TestHWISessionManager.class);
    String dataFileDir = conf.get("test.data.files").replace('\\', '/')
    .replace("c:", "");
    dataFilePath = new Path(dataFileDir, "kv1.txt");
  }
View Full Code Here

Examples of org.apache.hadoop.hive.conf.HiveConf

      if (!oproc.process_stage1(parts)) {
      }
    }

    SessionState.initHiveLog4j();
    conf = new HiveConf(SessionState.class);
    ss = new CliSessionState(conf);
    SessionState.start(ss);
    sp = new SetProcessor();
    qp = new Driver();
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.