Tabnine Logo
Row.getItems
Code IndexAdd Tabnine to your IDE (free)

How to use
getItems
method
in
com.facebook.presto.sql.tree.Row

Best Java code snippets using com.facebook.presto.sql.tree.Row.getItems (Showing top 20 results out of 315)

origin: prestodb/presto

@Override
protected String visitRow(Row node, Void context)
{
  return "ROW (" + Joiner.on(", ").join(node.getItems().stream()
      .map((child) -> process(child, context))
      .collect(toList())) + ")";
}
origin: prestodb/presto

@Override
protected R visitRow(Row node, C context)
{
  for (Expression expression : node.getItems()) {
    process(expression, context);
  }
  return null;
}
origin: prestodb/presto

@Override
public Boolean visitRow(Row node, final Void context)
{
  return node.getItems().stream()
      .allMatch(item -> process(item, context));
}
origin: prestodb/presto

@Override
protected Void visitRow(Row node, Integer indent)
{
  builder.append("ROW(");
  boolean firstItem = true;
  for (Expression item : node.getItems()) {
    if (!firstItem) {
      builder.append(", ");
    }
    process(item, indent);
    firstItem = false;
  }
  builder.append(")");
  return null;
}
origin: prestodb/presto

  @Override
  protected RowExpression visitRow(Row node, Void context)
  {
    List<RowExpression> arguments = node.getItems().stream()
        .map(value -> process(value, context))
        .collect(toImmutableList());
    Type returnType = getType(node);
    List<Type> argumentTypes = node.getItems().stream()
        .map(this::getType)
        .collect(toImmutableList());
    return call(rowConstructorSignature(returnType, argumentTypes), returnType, arguments);
  }
}
origin: prestodb/presto

@Override
protected Type visitRow(Row node, StackableAstVisitorContext<Context> context)
{
  List<Type> types = node.getItems().stream()
      .map((child) -> process(child, context))
      .collect(toImmutableList());
  Type type = RowType.anonymous(types);
  return setExpressionType(node, type);
}
origin: prestodb/presto

@Override
protected RelationPlan visitValues(Values node, Void context)
{
  Scope scope = analysis.getScope(node);
  ImmutableList.Builder<Symbol> outputSymbolsBuilder = ImmutableList.builder();
  for (Field field : scope.getRelationType().getVisibleFields()) {
    Symbol symbol = symbolAllocator.newSymbol(field);
    outputSymbolsBuilder.add(symbol);
  }
  ImmutableList.Builder<List<Expression>> rows = ImmutableList.builder();
  for (Expression row : node.getRows()) {
    ImmutableList.Builder<Expression> values = ImmutableList.builder();
    if (row instanceof Row) {
      for (Expression item : ((Row) row).getItems()) {
        Expression expression = Coercer.addCoercions(item, analysis);
        values.add(ExpressionTreeRewriter.rewriteWith(new ParameterRewriter(analysis.getParameters(), analysis), expression));
      }
    }
    else {
      Expression expression = Coercer.addCoercions(row, analysis);
      values.add(ExpressionTreeRewriter.rewriteWith(new ParameterRewriter(analysis.getParameters(), analysis), expression));
    }
    rows.add(values.build());
  }
  ValuesNode valuesNode = new ValuesNode(idAllocator.getNextId(), outputSymbolsBuilder.build(), rows.build());
  return new RelationPlan(valuesNode, scope, outputSymbolsBuilder.build());
}
origin: prestodb/presto

List<Expression> items = ((Row) row).getItems();
for (int i = 0; i < items.size(); i++) {
  Type expectedType = fieldTypes.get(i);
origin: prestodb/presto

@Override
protected Object visitRow(Row node, Object context)
{
  RowType rowType = (RowType) type(node);
  List<Type> parameterTypes = rowType.getTypeParameters();
  List<Expression> arguments = node.getItems();
  int cardinality = arguments.size();
  List<Object> values = new ArrayList<>(cardinality);
  for (Expression argument : arguments) {
    values.add(process(argument, context));
  }
  if (hasUnresolvedValue(values)) {
    return new Row(toExpressions(values, parameterTypes));
  }
  else {
    BlockBuilder blockBuilder = new RowBlockBuilder(parameterTypes, null, 1);
    BlockBuilder singleRowBlockWriter = blockBuilder.beginBlockEntry();
    for (int i = 0; i < cardinality; ++i) {
      writeNativeValue(parameterTypes.get(i), singleRowBlockWriter, values.get(i));
    }
    blockBuilder.closeEntry();
    return rowType.getObject(blockBuilder, 0);
  }
}
origin: rakam-io/rakam

@Override
protected String visitRow(Row node, Void context) {
  return "ROW (" + Joiner.on(", ").join(node.getItems().stream()
      .map((child) -> process(child, context))
      .collect(toList())) + ")";
}
origin: rakam-io/rakam

@Override
protected Void visitRow(Row node, Integer indent) {
  builder.append("ROW(");
  boolean firstItem = true;
  for (Expression item : node.getItems()) {
    if (!firstItem) {
      builder.append(", ");
    }
    process(item, indent);
    firstItem = false;
  }
  builder.append(")");
  return null;
}
origin: com.facebook.presto/presto-parser

@Override
protected R visitRow(Row node, C context)
{
  for (Expression expression : node.getItems()) {
    process(expression, context);
  }
  return null;
}
origin: com.facebook.presto/presto-parser

@Override
protected String visitRow(Row node, Void context)
{
  return "ROW (" + Joiner.on(", ").join(node.getItems().stream()
      .map((child) -> process(child, context))
      .collect(toList())) + ")";
}
origin: uk.co.nichesolutions.presto/presto-main

@Override
public Boolean visitRow(Row node, final Void context)
{
  return node.getItems().stream()
      .allMatch(item -> process(item, context));
}
origin: uk.co.nichesolutions.presto/presto-parser

@Override
protected R visitRow(Row node, C context)
{
  for (Expression expression : node.getItems()) {
    process(expression, context);
  }
  return null;
}
origin: uk.co.nichesolutions.presto/presto-parser

@Override
protected String visitRow(Row node, Boolean unmangleNames)
{
  return "ROW (" + Joiner.on(", ").join(node.getItems().stream()
      .map((child) -> process(child, unmangleNames))
      .collect(toList())) + ")";
}
origin: vqtran/EchoQuery

@Override
protected String visitRow(Row node, Boolean unmangleNames)
{
  return "ROW (" + Joiner.on(", ").join(node.getItems().stream()
      .map((child) -> process(child, unmangleNames))
      .collect(toList())) + ")";
}
origin: com.facebook.presto/presto-parser

@Override
protected Void visitRow(Row node, Integer indent)
{
  builder.append("ROW(");
  boolean firstItem = true;
  for (Expression item : node.getItems()) {
    if (!firstItem) {
      builder.append(", ");
    }
    process(item, indent);
    firstItem = false;
  }
  builder.append(")");
  return null;
}
origin: uk.co.nichesolutions.presto/presto-main

@Override
protected Type visitRow(Row node, StackableAstVisitorContext<AnalysisContext> context)
{
  List<Type> types = node.getItems().stream()
      .map((child) -> process(child, context))
      .collect(toImmutableList());
  Type type = new RowType(types, Optional.empty());
  expressionTypes.put(node, type);
  return type;
}
origin: Anchormen/sql4es

/**
 * Parses the list with values to insert and returns them as Objects
 */
@Override
public List<Object> visitValues(Values values, QueryState state){
  List<Object> result = new ArrayList<Object>();
  
  for(Expression rowExpression : values.getRows()){
    if(rowExpression instanceof Row) {
      Row row = (Row)rowExpression;
      for(Expression rowValue : row.getItems()){
        if(!(rowValue instanceof Literal)) {
          state.addException("Unable to parse non-literal value : "+rowValue);
          return result;
        }
        result.add(getObject((Literal)rowValue));
      }
    }else if (rowExpression instanceof Literal){
      result.add(getObject((Literal)rowExpression));
    }else {
      state.addException("Unknown VALUES type "+rowExpression.getClass()+" encountered");
      return null;
    }
  }
  return result;
}

com.facebook.presto.sql.treeRowgetItems

Popular methods of Row

  • <init>

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • getSystemService (Context)
  • onRequestPermissionsResult (Fragment)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now