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

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

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

origin: io.prestosql/presto-parser

public static Query simpleQuery(Select select, Relation from, Optional<Expression> where, Optional<GroupBy> groupBy, Optional<Expression> having, Optional<OrderBy> orderBy, Optional<String> limit)
{
  return query(new QuerySpecification(
      select,
      Optional.of(from),
      where,
      groupBy,
      having,
      orderBy,
      limit));
}
origin: io.prestosql/presto-parser

public static Query simpleQuery(Select select)
{
  return query(new QuerySpecification(
      select,
      Optional.empty(),
      Optional.empty(),
      Optional.empty(),
      Optional.empty(),
      Optional.empty(),
      Optional.empty()));
}
origin: prestosql/presto

public static Query simpleQuery(Select select)
{
  return query(new QuerySpecification(
      select,
      Optional.empty(),
      Optional.empty(),
      Optional.empty(),
      Optional.empty(),
      Optional.empty(),
      Optional.empty()));
}
origin: prestosql/presto

public static Query simpleQuery(Select select, Relation from, Optional<Expression> where, Optional<GroupBy> groupBy, Optional<Expression> having, Optional<OrderBy> orderBy, Optional<String> limit)
{
  return query(new QuerySpecification(
      select,
      Optional.of(from),
      where,
      groupBy,
      having,
      orderBy,
      limit));
}
origin: prestosql/presto

@Test
public void testLimitAll()
{
  Query valuesQuery = query(values(
      row(new LongLiteral("1"), new StringLiteral("1")),
      row(new LongLiteral("2"), new StringLiteral("2"))));
  assertStatement("SELECT * FROM (VALUES (1, '1'), (2, '2')) LIMIT ALL",
      simpleQuery(selectList(new AllColumns()),
          subquery(valuesQuery),
          Optional.empty(),
          Optional.empty(),
          Optional.empty(),
          Optional.empty(),
          Optional.of("ALL")));
}
origin: prestosql/presto

    query(new Values(ImmutableList.of(new LongLiteral("1")))),
    Optional.of(ImmutableList.of(identifier("x"))))))),
new Table(QualifiedName.of("t")),
origin: prestosql/presto

@Test
public void testValues()
{
  Query valuesQuery = query(values(
      row(new StringLiteral("a"), new LongLiteral("1"), new DoubleLiteral("2.2")),
      row(new StringLiteral("b"), new LongLiteral("2"), new DoubleLiteral("3.3"))));
  assertStatement("VALUES ('a', 1, 2.2e0), ('b', 2, 3.3e0)", valuesQuery);
  assertStatement("SELECT * FROM (VALUES ('a', 1, 2.2e0), ('b', 2, 3.3e0))",
      simpleQuery(
          selectList(new AllColumns()),
          subquery(valuesQuery)));
}
origin: prestosql/presto

@Test
public void testQuantifiedComparison()
{
  assertExpression("col1 < ANY (SELECT col2 FROM table1)",
      new QuantifiedComparisonExpression(
          LESS_THAN,
          QuantifiedComparisonExpression.Quantifier.ANY,
          identifier("col1"),
          new SubqueryExpression(simpleQuery(selectList(new SingleColumn(identifier("col2"))), table(QualifiedName.of("table1"))))));
  assertExpression("col1 = ALL (VALUES ROW(1), ROW(2))",
      new QuantifiedComparisonExpression(
          ComparisonExpression.Operator.EQUAL,
          QuantifiedComparisonExpression.Quantifier.ALL,
          identifier("col1"),
          new SubqueryExpression(query(values(row(new LongLiteral("1")), row(new LongLiteral("2")))))));
  assertExpression("col1 >= SOME (SELECT 10)",
      new QuantifiedComparisonExpression(
          ComparisonExpression.Operator.GREATER_THAN_OR_EQUAL,
          QuantifiedComparisonExpression.Quantifier.SOME,
          identifier("col1"),
          new SubqueryExpression(simpleQuery(selectList(new LongLiteral("10"))))));
}
io.prestosql.sqlQueryUtilquery

Popular methods of QueryUtil

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

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setContentView (Activity)
  • getContentResolver (Context)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • 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