Tabnine Logo
AliasedRelation.getAlias
Code IndexAdd Tabnine to your IDE (free)

How to use
getAlias
method
in
com.facebook.presto.sql.tree.AliasedRelation

Best Java code snippets using com.facebook.presto.sql.tree.AliasedRelation.getAlias (Showing top 11 results out of 315)

origin: prestodb/presto

@Override
protected Void visitAliasedRelation(AliasedRelation node, Integer indentLevel)
{
  print(indentLevel, "Alias[" + node.getAlias() + "]");
  super.visitAliasedRelation(node, indentLevel + 1);
  return null;
}
origin: prestodb/presto

@Override
protected Void visitAliasedRelation(AliasedRelation node, Integer indent)
{
  process(node.getRelation(), indent);
  builder.append(' ')
      .append(formatExpression(node.getAlias(), parameters));
  appendAliasColumns(builder, node.getColumnNames());
  return null;
}
origin: prestodb/presto

@Override
protected Scope visitAliasedRelation(AliasedRelation relation, Optional<Scope> scope)
{
  Scope relationScope = process(relation.getRelation(), scope);
  // todo this check should be inside of TupleDescriptor.withAlias, but the exception needs the node object
  RelationType relationType = relationScope.getRelationType();
  if (relation.getColumnNames() != null) {
    int totalColumns = relationType.getVisibleFieldCount();
    if (totalColumns != relation.getColumnNames().size()) {
      throw new SemanticException(MISMATCHED_COLUMN_ALIASES, relation, "Column alias list has %s entries but '%s' has %s columns available", relation.getColumnNames().size(), relation.getAlias(), totalColumns);
    }
  }
  List<String> aliases = null;
  if (relation.getColumnNames() != null) {
    aliases = relation.getColumnNames().stream()
        .map(Identifier::getValue)
        .collect(Collectors.toList());
  }
  RelationType descriptor = relationType.withAlias(relation.getAlias().getValue(), aliases);
  return createAndAssignScope(relation, scope, descriptor);
}
origin: rakam-io/rakam

@Override
protected Void visitAliasedRelation(AliasedRelation node, Integer indent) {
  process(node.getRelation(), indent);
  builder.append(' ')
      .append(formatExpression(node.getAlias(), tableNameMapper, columnNameMapper, queryWithTables, escapeIdentifier));
  appendAliasColumns(builder, node.getColumnNames());
  return null;
}
origin: uk.co.nichesolutions.presto/presto-parser

@Override
protected Void visitAliasedRelation(AliasedRelation node, Integer indentLevel)
{
  print(indentLevel, "Alias[" + node.getAlias() + "]");
  super.visitAliasedRelation(node, indentLevel + 1);
  return null;
}
origin: com.facebook.presto/presto-parser

@Override
protected Void visitAliasedRelation(AliasedRelation node, Integer indentLevel)
{
  print(indentLevel, "Alias[" + node.getAlias() + "]");
  super.visitAliasedRelation(node, indentLevel + 1);
  return null;
}
origin: uk.co.nichesolutions.presto/presto-parser

@Override
protected Void visitAliasedRelation(AliasedRelation node, Integer indent)
{
  process(node.getRelation(), indent);
  builder.append(' ')
      .append(node.getAlias());
  appendAliasColumns(builder, node.getColumnNames());
  return null;
}
origin: vqtran/EchoQuery

@Override
protected Void visitAliasedRelation(AliasedRelation node, Integer indent)
{
  process(node.getRelation(), indent);
  builder.append(' ')
      .append(node.getAlias());
  appendAliasColumns(builder, node.getColumnNames());
  return null;
}
origin: com.facebook.presto/presto-parser

@Override
protected Void visitAliasedRelation(AliasedRelation node, Integer indent)
{
  process(node.getRelation(), indent);
  builder.append(' ')
      .append(formatExpression(node.getAlias(), parameters));
  appendAliasColumns(builder, node.getColumnNames());
  return null;
}
origin: uk.co.nichesolutions.presto/presto-main

@Override
protected RelationType visitAliasedRelation(AliasedRelation relation, AnalysisContext context)
{
  RelationType child = process(relation.getRelation(), context);
  // todo this check should be inside of TupleDescriptor.withAlias, but the exception needs the node object
  if (relation.getColumnNames() != null) {
    int totalColumns = child.getVisibleFieldCount();
    if (totalColumns != relation.getColumnNames().size()) {
      throw new SemanticException(MISMATCHED_COLUMN_ALIASES, relation, "Column alias list has %s entries but '%s' has %s columns available", relation.getColumnNames().size(), relation.getAlias(), totalColumns);
    }
  }
  RelationType descriptor = child.withAlias(relation.getAlias(), relation.getColumnNames());
  analysis.setOutputDescriptor(relation, descriptor);
  return descriptor;
}
origin: Anchormen/sql4es

@Override
protected List<QuerySource> visitRelation(Relation node, QueryState state){
  if(node instanceof Join){
    return node.accept(this, state);
  }else if( node instanceof SampledRelation){
    state.addException("Sampled relations are not supported");
    return null;
  }else if( node instanceof AliasedRelation){
    AliasedRelation ar = (AliasedRelation)node;
    state.setKeyValue("table_alias", ar.getAlias());
    List<QuerySource> relations = ar.getRelation().accept(this, state);
    for(QuerySource rr : relations) rr.setAlias(ar.getAlias()); //.getValue());
    return relations;
  }else if( node instanceof QueryBody){
    return node.accept(this, state);
  }else{
    state.addException("Unable to parse node because it has an unknown type :"+node.getClass());
    return null;
  }
}

com.facebook.presto.sql.treeAliasedRelationgetAlias

Popular methods of AliasedRelation

  • getRelation
  • getColumnNames
  • <init>

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getContentResolver (Context)
  • getSharedPreferences (Context)
  • getApplicationContext (Context)
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • JPanel (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top Vim plugins
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