Package org.springframework.data.hadoop.hive

Examples of org.springframework.data.hadoop.hive.HiveScript


  @Test
  public void testTemplateExecute() throws Exception {
    String location = "classpath:org/springframework/data/hadoop/hive/script.q";
    Resource res = ctx.getResource(location);
    assertTrue(res.exists());
    assertTrue(!template.executeScript(new HiveScript(res)).isEmpty());
  }
View Full Code Here


    params.put("xxx", "nonExisting");
    params.put("data", uri);
    params.put("zzz", "onions");
    params.put("yyy", "unleashed");

    template.executeScript(new HiveScript(prep, params));
    List<String> run = template.executeScript(new HiveScript(res, params));
    System.out.println(run);
    assertEquals("zzz=onions", run.get(0));
    assertEquals("hiveconf:yyy=unleashed", run.get(1));
    assertEquals("10", run.get(2));
  }
View Full Code Here

    Resource res = new ByteArrayResource("set zzz;set hiveconf:yyy;".getBytes());
    Properties params = new Properties();
    params.put("zzz", "onions");
    params.put("yyy", "unleashed");

    List<String> run = template.executeScript(new HiveScript(res, params));
    assertEquals("zzz=onions", run.get(0));
    assertEquals("hiveconf:yyy=unleashed", run.get(1));
  }
View Full Code Here

    Map parameters = new HashMap();
    parameters.put("hiveContribJar", hiveContribJar);
    parameters.put("localInPath", localInPath);
    //hiveOperations.query(scriptResource, parameters);
    Resource res = resourceLoader.getResource(scriptResource);
    hiveOperations.executeScript(new HiveScript(res,parameters)  );
  }
View Full Code Here

    }

    StringBuilder sb = new StringBuilder();
   
    try {
      sb.append(StringUtils.collectionToDelimitedString(hiveTemplate.executeScript(new HiveScript(resource)),
          OsUtils.LINE_SEPARATOR));
    } catch (Exception ex) {
      return "Script [" + uri + "] failed - " + ex;
    }
   
View Full Code Here

    }

    StringBuilder sb = new StringBuilder();
   
    try {
      sb.append(StringUtils.collectionToDelimitedString(hiveTemplate.executeScript(new HiveScript(resource)),
          StringUtils.LINE_SEPARATOR));
    } catch (Exception ex) {
      return "Script [" + uri + "] failed - " + ex;
    }
   
View Full Code Here

TOP

Related Classes of org.springframework.data.hadoop.hive.HiveScript

Copyright © 2018 www.massapicom. 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.