Tabnine Logo
AliasedRelation.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.facebook.presto.sql.tree.AliasedRelation
constructor

Best Java code snippets using com.facebook.presto.sql.tree.AliasedRelation.<init> (Showing top 10 results out of 315)

origin: prestodb/presto

public static Relation aliased(Relation relation, String alias, List<String> columnAliases)
{
  return new AliasedRelation(
      relation,
      identifier(alias),
      columnAliases.stream()
          .map(QueryUtil::identifier)
          .collect(Collectors.toList()));
}
origin: prestodb/presto

@Override
public Node visitAliasedRelation(SqlBaseParser.AliasedRelationContext context)
{
  Relation child = (Relation) visit(context.relationPrimary());
  if (context.identifier() == null) {
    return child;
  }
  List<Identifier> aliases = null;
  if (context.columnAliases() != null) {
    aliases = visit(context.columnAliases().identifier(), Identifier.class);
  }
  return new AliasedRelation(getLocation(context), child, (Identifier) visit(context.identifier()), aliases);
}
origin: prestodb/presto

Join.Type.IMPLICIT,
new Table(QualifiedName.of("t")),
new AliasedRelation(lateralRelation, identifier("a"), ImmutableList.of(identifier("x"))),
Optional.empty())));
origin: prestodb/presto

@Test
public void testUnnest()
{
  assertStatement("SELECT * FROM t CROSS JOIN UNNEST(a)",
      simpleQuery(
          selectList(new AllColumns()),
          new Join(
              Join.Type.CROSS,
              new Table(QualifiedName.of("t")),
              new Unnest(ImmutableList.of(new Identifier("a")), false),
              Optional.empty())));
  assertStatement("SELECT * FROM t CROSS JOIN UNNEST(a, b) WITH ORDINALITY",
      simpleQuery(
          selectList(new AllColumns()),
          new Join(
              Join.Type.CROSS,
              new Table(QualifiedName.of("t")),
              new Unnest(ImmutableList.of(new Identifier("a"), new Identifier("b")), true),
              Optional.empty())));
  assertStatement("SELECT * FROM t FULL JOIN UNNEST(a) AS tmp (c) ON true",
      simpleQuery(
          selectList(new AllColumns()),
          new Join(
              Join.Type.FULL,
              new Table(QualifiedName.of("t")),
              new AliasedRelation(new Unnest(ImmutableList.of(new Identifier("a")), false), new Identifier("tmp"), ImmutableList.of(new Identifier("c"))),
              Optional.of(new JoinOn(BooleanLiteral.TRUE_LITERAL)))));
}
origin: uk.co.nichesolutions.presto/presto-parser

public static Relation aliased(Relation relation, String alias, List<String> columnAliases)
{
  return new AliasedRelation(relation, alias, columnAliases);
}
origin: com.facebook.presto/presto-parser

public static Relation aliased(Relation relation, String alias, List<String> columnAliases)
{
  return new AliasedRelation(
      relation,
      identifier(alias),
      columnAliases.stream()
          .map(QueryUtil::identifier)
          .collect(Collectors.toList()));
}
origin: uk.co.nichesolutions.presto/presto-parser

@Override
public Node visitAliasedRelation(SqlBaseParser.AliasedRelationContext context)
{
  Relation child = (Relation) visit(context.relationPrimary());
  if (context.identifier() == null) {
    return child;
  }
  return new AliasedRelation(getLocation(context), child, context.identifier().getText(), getColumnAliases(context.columnAliases()));
}
origin: com.facebook.presto/presto-parser

@Override
public Node visitAliasedRelation(SqlBaseParser.AliasedRelationContext context)
{
  Relation child = (Relation) visit(context.relationPrimary());
  if (context.identifier() == null) {
    return child;
  }
  List<Identifier> aliases = null;
  if (context.columnAliases() != null) {
    aliases = visit(context.columnAliases().identifier(), Identifier.class);
  }
  return new AliasedRelation(getLocation(context), child, (Identifier) visit(context.identifier()), aliases);
}
origin: com.facebook.presto/presto-parser

Join.Type.IMPLICIT,
new Table(QualifiedName.of("t")),
new AliasedRelation(lateralRelation, identifier("a"), ImmutableList.of(identifier("x"))),
Optional.empty())));
origin: com.facebook.presto/presto-parser

@Test
public void testUnnest()
{
  assertStatement("SELECT * FROM t CROSS JOIN UNNEST(a)",
      simpleQuery(
          selectList(new AllColumns()),
          new Join(
              Join.Type.CROSS,
              new Table(QualifiedName.of("t")),
              new Unnest(ImmutableList.of(new Identifier("a")), false),
              Optional.empty())));
  assertStatement("SELECT * FROM t CROSS JOIN UNNEST(a, b) WITH ORDINALITY",
      simpleQuery(
          selectList(new AllColumns()),
          new Join(
              Join.Type.CROSS,
              new Table(QualifiedName.of("t")),
              new Unnest(ImmutableList.of(new Identifier("a"), new Identifier("b")), true),
              Optional.empty())));
  assertStatement("SELECT * FROM t FULL JOIN UNNEST(a) AS tmp (c) ON true",
      simpleQuery(
          selectList(new AllColumns()),
          new Join(
              Join.Type.FULL,
              new Table(QualifiedName.of("t")),
              new AliasedRelation(new Unnest(ImmutableList.of(new Identifier("a")), false), new Identifier("tmp"), ImmutableList.of(new Identifier("c"))),
              Optional.of(new JoinOn(BooleanLiteral.TRUE_LITERAL)))));
}
com.facebook.presto.sql.treeAliasedRelation<init>

Popular methods of AliasedRelation

  • getAlias
  • getRelation
  • getColumnNames

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • compareTo (BigDecimal)
  • getContentResolver (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • JFileChooser (javax.swing)
  • Github Copilot alternatives
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