Examples of exprNodeConstantDesc


Examples of org.apache.hadoop.hive.ql.plan.exprNodeConstantDesc

        // do nothing here, we will throw an exception in the following block
      }
      if (v == null) {
        throw new SemanticException(ErrorMsg.INVALID_NUMERICAL_CONSTANT.getMsg(expr));
      }
      return new exprNodeConstantDesc(v);
    }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.exprNodeConstantDesc

      default:
        // HiveParser.identifier | HiveParse.KW_IF | HiveParse.KW_LEFT | HiveParse.KW_RIGHT
        str = BaseSemanticAnalyzer.unescapeIdentifier(expr.getText());
        break;
      }
      return new exprNodeConstantDesc(TypeInfoFactory.stringTypeInfo, str);
    }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.exprNodeConstantDesc

        bool = Boolean.FALSE;
        break;
      default:
        assert false;
      }
      return new exprNodeConstantDesc(TypeInfoFactory.booleanTypeInfo, bool);     
    }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.exprNodeConstantDesc

        // "." :  FIELD Expression
        assert(children.size() == 2);
        // Only allow constant field name for now
        assert(children.get(1) instanceof exprNodeConstantDesc);
        exprNodeDesc object = children.get(0);
        exprNodeConstantDesc fieldName = (exprNodeConstantDesc)children.get(1);
        assert(fieldName.getValue() instanceof String);
       
        // Calculate result TypeInfo
        String fieldNameString = (String)fieldName.getValue();
        TypeInfo objectTypeInfo = object.getTypeInfo();
       
        // Allow accessing a field of list element structs directly from a list 
        boolean isList = (object.getTypeInfo().getCategory() == ObjectInspector.Category.LIST);
        if (isList) {
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.exprNodeConstantDesc

      exprNodeColumnDesc cd = (exprNodeColumnDesc) nd;
      ExprProcCtx epc = (ExprProcCtx) procCtx;
      if (cd.getTabAlias().equalsIgnoreCase(epc.getTabAlias()) && cd.getIsParititonCol())
        newcd = cd.clone();
      else {
        newcd = new exprNodeConstantDesc(cd.getTypeInfo(), null);
        epc.setHasNonPartCols(true);
      }
     
      return newcd;
    }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.exprNodeConstantDesc

          }
        }
      }
     
      if (unknown)
        newfd = new exprNodeConstantDesc(fd.getTypeInfo(), null);
      else {
        // Create the list of children
        ArrayList<exprNodeDesc> children = new ArrayList<exprNodeDesc>();
        for(Object child: nodeOutputs) {
          children.add((exprNodeDesc) child);
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.exprNodeConstantDesc

      assert(idx == 0);

      exprNodeDesc newnd = null;
      if (unknown) {
        newnd = new exprNodeConstantDesc(fnd.getTypeInfo(), null);
      }
      else {
        newnd = new exprNodeFieldDesc(fnd.getTypeInfo(), left_nd, fnd.getFieldName(), fnd.getIsList());
      }
      return newnd;
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.exprNodeConstantDesc

    ArrayList<String> columnNames = new ArrayList<String>();
    Map<String, exprNodeDesc> colExprMap = new HashMap<String, exprNodeDesc>();
    for (int i=0; i<col_list.size(); i++) {
      // Replace NULL with CAST(NULL AS STRING)
      if (col_list.get(i) instanceof exprNodeNullDesc) {
        col_list.set(i, new exprNodeConstantDesc(TypeInfoFactory.stringTypeInfo, null));
      }
      String outputCol = getColumnInternalName(i);
      colExprMap.put(outputCol, col_list.get(i));
      columnNames.add(outputCol);
    }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.exprNodeConstantDesc

  private exprNodeDesc genSamplePredicate(TableSample ts, List<String> bucketCols,
                                      boolean useBucketCols, String alias,
                                      RowResolver rwsch, QBMetaData qbm, exprNodeDesc planExpr)
    throws SemanticException {

    exprNodeDesc numeratorExpr = new exprNodeConstantDesc(
        TypeInfoFactory.intTypeInfo,
        Integer.valueOf(ts.getNumerator() - 1));

    exprNodeDesc denominatorExpr = new exprNodeConstantDesc(
        TypeInfoFactory.intTypeInfo,
        Integer.valueOf(ts.getDenominator()));

    exprNodeDesc intMaxExpr = new exprNodeConstantDesc(
        TypeInfoFactory.intTypeInfo,
        Integer.valueOf(Integer.MAX_VALUE));

    ArrayList<exprNodeDesc> args = new ArrayList<exprNodeDesc>();
    if (planExpr != null)
View Full Code Here

Examples of org.apache.hadoop.hive.ql.plan.exprNodeConstantDesc

            int freq = conf.getIntVar(HiveConf.ConfVars.HIVETESTMODESAMPLEFREQ);
            TableSample tsSample = new TableSample(1, freq);
            tsSample.setInputPruning(false);
            qb.getParseInfo().setTabSample(alias, tsSample);
            LOG.info("Need sample filter");
            exprNodeDesc randFunc = TypeCheckProcFactory.DefaultExprProcessor.getFuncExprNodeDesc("rand", new exprNodeConstantDesc(Integer.valueOf(460476415)));
            exprNodeDesc samplePred = genSamplePredicate(tsSample, null, false, alias, rwsch, qb.getMetaData(), randFunc);
            tableOp = OperatorFactory.getAndMakeChild(new filterDesc(samplePred, true), top);
          }
        }
      }
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.