Package org.apache.hadoop.hive.ql.parse

Examples of org.apache.hadoop.hive.ql.parse.ASTNode.toStringTree()


  }

  @Test
  public void testAddPartition() throws Exception {
    ASTNode ast = parse("alter table parted add partition (day='Monday')");
    LOG.info("AST: " + ast.toStringTree());
    AccessURI partitionLocation = HiveAuthzBindingHook.extractPartition(ast);
    Assert.assertNull("Query without part location should not return location",
        partitionLocation);
  }
  @Test
View Full Code Here


        partitionLocation);
  }
  @Test
  public void testAddPartitionWithLocation() throws Exception {
    ASTNode ast = parse("alter table parted add partition (day='Monday') location 'file:/'");
    LOG.info("AST: " + ast.toStringTree());
    AccessURI partitionLocation = HiveAuthzBindingHook.extractPartition(ast);
    Assert.assertNotNull("Query with part location must return location",
        partitionLocation);
    Assert.assertEquals("file:///", partitionLocation.getName());
  }
View Full Code Here

  }

  @Test
  public void testAddPartitionIfNotExists() throws Exception {
    ASTNode ast = parse("alter table parted add if not exists partition (day='Monday')");
    LOG.info("AST: " + ast.toStringTree());
    AccessURI partitionLocation = HiveAuthzBindingHook.extractPartition(ast);
    Assert.assertNull("Query without part location should not return location",
        partitionLocation);
  }
  @Test
View Full Code Here

  }
  @Test
  public void testAddPartitionIfNotExistsWithLocation() throws Exception {
    ASTNode ast = parse("alter table parted add if not exists partition (day='Monday')" +
        " location 'file:/'");
    LOG.info("AST: " + ast.toStringTree());
    AccessURI partitionLocation = HiveAuthzBindingHook.extractPartition(ast);
    Assert.assertNotNull("Query with part location must return location",
        partitionLocation);
    Assert.assertEquals("file:///", partitionLocation.getName());
  }
View Full Code Here

      }
      ASTNode inExpr = null;
      inExpr = PTFTranslator.getASTNode(inpCInfo, inputRR);
      if ( inExpr != null ) {
        rr.putExpression(inExpr, cInfo);
        colAlias = inExpr.toStringTree().toLowerCase();
      }
      else {
        colAlias = colAlias == null ? cInfo.getInternalName() : colAlias;
        rr.put(cInfo.getTabAlias(), colAlias, cInfo);
      }
View Full Code Here

      }
      ASTNode inExpr = null;
      inExpr = PTFTranslator.getASTNode(inpCInfo, inputRR);
      if ( inExpr != null ) {
        rr.putExpression(inExpr, cInfo);
        colAlias = inExpr.toStringTree().toLowerCase();
      }
      else {
        colAlias = colAlias == null ? cInfo.getInternalName() : colAlias;
        rr.put(cInfo.getTabAlias(), colAlias, cInfo);
      }
View Full Code Here

      }
      ASTNode inExpr = null;
      inExpr = PTFTranslator.getASTNode(inpCInfo, inputRR);
      if ( inExpr != null ) {
        rr.putExpression(inExpr, cInfo);
        colAlias = inExpr.toStringTree().toLowerCase();
      }
      else {
        colAlias = colAlias == null ? cInfo.getInternalName() : colAlias;
        rr.put(cInfo.getTabAlias(), colAlias, cInfo);
      }
View Full Code Here

      }
      ASTNode inExpr = null;
      inExpr = PTFTranslator.getASTNode(inpCInfo, inputRR);
      if ( inExpr != null ) {
        rr.putExpression(inExpr, cInfo);
        colAlias = inExpr.toStringTree().toLowerCase();
      }
      else {
        colAlias = colAlias == null ? cInfo.getInternalName() : colAlias;
        rr.put(cInfo.getTabAlias(), colAlias, cInfo);
      }
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.