Tabnine Logo
QueryUtil.identifier
Code IndexAdd Tabnine to your IDE (free)

How to use
identifier
method
in
io.prestosql.sql.QueryUtil

Best Java code snippets using io.prestosql.sql.QueryUtil.identifier (Showing top 20 results out of 315)

origin: io.prestosql/presto-parser

public static SelectItem aliasedName(String name, String alias)
{
  return new SingleColumn(identifier(name), identifier(alias));
}
origin: io.prestosql/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: prestosql/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: prestosql/presto

public static SelectItem unaliasedName(String name)
{
  return new SingleColumn(identifier(name));
}
origin: io.prestosql/presto-parser

public static SelectItem aliasedNullToEmpty(String column, String alias)
{
  return new SingleColumn(new CoalesceExpression(identifier(column), new StringLiteral("")), identifier(alias));
}
origin: prestosql/presto

@Test
public void testRenameColumn()
{
  assertStatement("ALTER TABLE foo.t RENAME COLUMN a TO b", new RenameColumn(QualifiedName.of("foo", "t"), identifier("a"), identifier("b")));
}
origin: prestosql/presto

@Test
public void testExecute()
{
  assertStatement("EXECUTE myquery", new Execute(identifier("myquery"), emptyList()));
}
origin: prestosql/presto

@Test
public void testShowSchemas()
{
  assertStatement("SHOW SCHEMAS", new ShowSchemas(Optional.empty(), Optional.empty(), Optional.empty()));
  assertStatement("SHOW SCHEMAS FROM foo", new ShowSchemas(Optional.of(identifier("foo")), Optional.empty(), Optional.empty()));
  assertStatement("SHOW SCHEMAS IN foo LIKE '%'", new ShowSchemas(Optional.of(identifier("foo")), Optional.of("%"), Optional.empty()));
  assertStatement("SHOW SCHEMAS IN foo LIKE '%$_%' ESCAPE '$'", new ShowSchemas(Optional.of(identifier("foo")), Optional.of("%$_%"), Optional.of("$")));
}
origin: prestosql/presto

@Test
public void testDeallocatePrepare()
{
  assertStatement("DEALLOCATE PREPARE myquery", new Deallocate(identifier("myquery")));
}
origin: prestosql/presto

@Test
public void testDescribeOutput()
{
  assertStatement("DESCRIBE OUTPUT myquery", new DescribeOutput(identifier("myquery")));
}
origin: prestosql/presto

@Test
public void testDescribeInput()
{
  assertStatement("DESCRIBE INPUT myquery", new DescribeInput(identifier("myquery")));
}
origin: io.prestosql/presto-main

@Test
public void testCreateTableNotExistsTrue()
{
  CreateTable statement = new CreateTable(QualifiedName.of("test_table"),
      ImmutableList.of(new ColumnDefinition(identifier("a"), "BIGINT", emptyList(), Optional.empty())),
      true,
      ImmutableList.of(),
      Optional.empty());
  getFutureValue(new CreateTableTask().internalExecute(statement, metadata, new AllowAllAccessControl(), testSession, emptyList()));
  assertEquals(metadata.getCreateTableCallCount(), 1);
}
origin: prestosql/presto

@Test
public void testAddColumn()
{
  assertStatement("ALTER TABLE foo.t ADD COLUMN c bigint", new AddColumn(QualifiedName.of("foo", "t"),
      new ColumnDefinition(identifier("c"), "bigint", emptyList(), Optional.empty())));
}
origin: prestosql/presto

@Test
public void testCreateTableNotExistsTrue()
{
  CreateTable statement = new CreateTable(QualifiedName.of("test_table"),
      ImmutableList.of(new ColumnDefinition(identifier("a"), "BIGINT", emptyList(), Optional.empty())),
      true,
      ImmutableList.of(),
      Optional.empty());
  getFutureValue(new CreateTableTask().internalExecute(statement, metadata, new AllowAllAccessControl(), testSession, emptyList()));
  assertEquals(metadata.getCreateTableCallCount(), 1);
}
origin: prestosql/presto

@Test
public void testInsertInto()
{
  QualifiedName table = QualifiedName.of("a");
  Query query = simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t")));
  assertStatement("INSERT INTO a SELECT * FROM t",
      new Insert(table, Optional.empty(), query));
  assertStatement("INSERT INTO a (c1, c2) SELECT * FROM t",
      new Insert(table, Optional.of(ImmutableList.of(identifier("c1"), identifier("c2"))), query));
}
origin: prestosql/presto

@Test
public void testRenameSchema()
{
  assertStatement("ALTER SCHEMA foo RENAME TO bar",
      new RenameSchema(QualifiedName.of("foo"), identifier("bar")));
  assertStatement("ALTER SCHEMA foo.bar RENAME TO baz",
      new RenameSchema(QualifiedName.of("foo", "bar"), identifier("baz")));
  assertStatement("ALTER SCHEMA \"awesome schema\".\"awesome table\" RENAME TO \"even more awesome table\"",
      new RenameSchema(QualifiedName.of("awesome schema", "awesome table"), quotedIdentifier("even more awesome table")));
}
origin: prestosql/presto

@Test
public void testExecuteWithUsing()
{
  assertStatement("EXECUTE myquery USING 1, 'abc', ARRAY ['hello']",
      new Execute(identifier("myquery"), ImmutableList.of(new LongLiteral("1"), new StringLiteral("abc"), new ArrayConstructor(ImmutableList.of(new StringLiteral("hello"))))));
}
origin: prestosql/presto

@Test
public void testDropColumn()
{
  assertStatement("ALTER TABLE foo.t DROP COLUMN c", new DropColumn(QualifiedName.of("foo", "t"), identifier("c")));
  assertStatement("ALTER TABLE \"t x\" DROP COLUMN \"c d\"", new DropColumn(QualifiedName.of("t x"), quotedIdentifier("c d")));
}
origin: prestosql/presto

@Test
public void testPrepare()
{
  assertStatement("PREPARE myquery FROM select * from foo",
      new Prepare(identifier("myquery"), simpleQuery(
          selectList(new AllColumns()),
          table(QualifiedName.of("foo")))));
}
origin: prestosql/presto

@Test
public void testPrepareWithParameters()
{
  assertStatement("PREPARE myquery FROM SELECT ?, ? FROM foo",
      new Prepare(identifier("myquery"), simpleQuery(
          selectList(new Parameter(0), new Parameter(1)),
          table(QualifiedName.of("foo")))));
}
io.prestosql.sqlQueryUtilidentifier

Popular methods of QueryUtil

  • selectList
  • simpleQuery
  • row
  • table
  • values
  • aliased
  • query
  • aliasedName
  • aliasedNullToEmpty
  • ascending
  • equal
  • functionCall
  • equal,
  • functionCall,
  • logicalAnd,
  • ordering,
  • quotedIdentifier,
  • selectAll,
  • singleValueQuery,
  • subquery

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (Timer)
  • onCreateOptionsMenu (Activity)
  • getApplicationContext (Context)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Path (java.nio.file)
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Top plugins for WebStorm
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