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

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

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

origin: prestodb/presto

@Override
public Node visitExplainType(SqlBaseParser.ExplainTypeContext context)
{
  switch (context.value.getType()) {
    case SqlBaseLexer.LOGICAL:
      return new ExplainType(getLocation(context), ExplainType.Type.LOGICAL);
    case SqlBaseLexer.DISTRIBUTED:
      return new ExplainType(getLocation(context), ExplainType.Type.DISTRIBUTED);
    case SqlBaseLexer.VALIDATE:
      return new ExplainType(getLocation(context), ExplainType.Type.VALIDATE);
    case SqlBaseLexer.IO:
      return new ExplainType(getLocation(context), ExplainType.Type.IO);
  }
  throw new IllegalArgumentException("Unsupported EXPLAIN type: " + context.value.getText());
}
origin: prestodb/presto

@Override
protected Scope visitExplain(Explain node, Optional<Scope> scope)
    throws SemanticException
{
  checkState(node.isAnalyze(), "Non analyze explain should be rewritten to Query");
  if (node.getOptions().stream().anyMatch(option -> !option.equals(new ExplainType(DISTRIBUTED)))) {
    throw new SemanticException(NOT_SUPPORTED, node, "EXPLAIN ANALYZE only supports TYPE DISTRIBUTED option");
  }
  process(node.getStatement(), scope);
  analysis.setUpdateType(null);
  return createAndAssignScope(node, scope, Field.newUnqualified("Query Plan", VARCHAR));
}
origin: prestodb/presto

@Test
public void testExplainVerboseTypeLogical()
{
  assertStatement("EXPLAIN VERBOSE (type LOGICAL) SELECT * FROM t",
      new Explain(simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t"))), false, true, ImmutableList.of(new ExplainType(ExplainType.Type.LOGICAL))));
}
origin: prestodb/presto

@Test
public void testExplainAnalyzeTypeDistributed()
{
  assertStatement("EXPLAIN ANALYZE (type DISTRIBUTED) SELECT * FROM t",
      new Explain(simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t"))), true, false, ImmutableList.of(new ExplainType(ExplainType.Type.DISTRIBUTED))));
}
origin: prestodb/presto

@Test
public void testExplainAnalyzeVerboseTypeDistributed()
{
  assertStatement("EXPLAIN ANALYZE VERBOSE (type DISTRIBUTED) SELECT * FROM t",
      new Explain(simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t"))), true, true, ImmutableList.of(new ExplainType(ExplainType.Type.DISTRIBUTED))));
}
origin: prestodb/presto

@Test
public void testExplain()
{
  assertStatement("EXPLAIN SELECT * FROM t",
      new Explain(simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t"))), false, false, ImmutableList.of()));
  assertStatement("EXPLAIN (TYPE LOGICAL) SELECT * FROM t",
      new Explain(
          simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t"))),
          false,
          false,
          ImmutableList.of(new ExplainType(ExplainType.Type.LOGICAL))));
  assertStatement("EXPLAIN (TYPE LOGICAL, FORMAT TEXT) SELECT * FROM t",
      new Explain(
          simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t"))),
          false,
          false,
          ImmutableList.of(
              new ExplainType(ExplainType.Type.LOGICAL),
              new ExplainFormat(ExplainFormat.Type.TEXT))));
}
origin: uk.co.nichesolutions.presto/presto-parser

@Override
public Node visitExplainType(SqlBaseParser.ExplainTypeContext context)
{
  switch (context.value.getType()) {
    case SqlBaseLexer.LOGICAL:
      return new ExplainType(getLocation(context), ExplainType.Type.LOGICAL);
    case SqlBaseLexer.DISTRIBUTED:
      return new ExplainType(getLocation(context), ExplainType.Type.DISTRIBUTED);
  }
  throw new IllegalArgumentException("Unsupported EXPLAIN type: " + context.value.getText());
}
origin: com.facebook.presto/presto-parser

@Override
public Node visitExplainType(SqlBaseParser.ExplainTypeContext context)
{
  switch (context.value.getType()) {
    case SqlBaseLexer.LOGICAL:
      return new ExplainType(getLocation(context), ExplainType.Type.LOGICAL);
    case SqlBaseLexer.DISTRIBUTED:
      return new ExplainType(getLocation(context), ExplainType.Type.DISTRIBUTED);
    case SqlBaseLexer.VALIDATE:
      return new ExplainType(getLocation(context), ExplainType.Type.VALIDATE);
    case SqlBaseLexer.IO:
      return new ExplainType(getLocation(context), ExplainType.Type.IO);
  }
  throw new IllegalArgumentException("Unsupported EXPLAIN type: " + context.value.getText());
}
origin: com.facebook.presto/presto-parser

@Test
public void testExplainAnalyzeVerboseTypeDistributed()
{
  assertStatement("EXPLAIN ANALYZE VERBOSE (type DISTRIBUTED) SELECT * FROM t",
      new Explain(simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t"))), true, true, ImmutableList.of(new ExplainType(ExplainType.Type.DISTRIBUTED))));
}
origin: com.facebook.presto/presto-parser

@Test
public void testExplainVerboseTypeLogical()
{
  assertStatement("EXPLAIN VERBOSE (type LOGICAL) SELECT * FROM t",
      new Explain(simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t"))), false, true, ImmutableList.of(new ExplainType(ExplainType.Type.LOGICAL))));
}
origin: com.facebook.presto/presto-parser

@Test
public void testExplainAnalyzeTypeDistributed()
{
  assertStatement("EXPLAIN ANALYZE (type DISTRIBUTED) SELECT * FROM t",
      new Explain(simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t"))), true, false, ImmutableList.of(new ExplainType(ExplainType.Type.DISTRIBUTED))));
}
origin: uk.co.nichesolutions.presto/presto-main

if (node.getOptions().stream().anyMatch(option -> !option.equals(new ExplainType(DISTRIBUTED)))) {
  throw new SemanticException(NOT_SUPPORTED, node, "EXPLAIN ANALYZE only supports TYPE DISTRIBUTED option");
origin: uk.co.nichesolutions.presto/presto-parser

@Test
public void testExplain()
    throws Exception
{
  assertStatement("EXPLAIN SELECT * FROM t",
      new Explain(simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t"))), false, ImmutableList.of()));
  assertStatement("EXPLAIN (TYPE LOGICAL) SELECT * FROM t",
      new Explain(
          simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t"))),
          false,
          ImmutableList.of(new ExplainType(ExplainType.Type.LOGICAL))));
  assertStatement("EXPLAIN (TYPE LOGICAL, FORMAT TEXT) SELECT * FROM t",
      new Explain(
          simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t"))),
          false,
          ImmutableList.of(
              new ExplainType(ExplainType.Type.LOGICAL),
              new ExplainFormat(ExplainFormat.Type.TEXT))));
}
origin: com.facebook.presto/presto-parser

@Test
public void testExplain()
{
  assertStatement("EXPLAIN SELECT * FROM t",
      new Explain(simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t"))), false, false, ImmutableList.of()));
  assertStatement("EXPLAIN (TYPE LOGICAL) SELECT * FROM t",
      new Explain(
          simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t"))),
          false,
          false,
          ImmutableList.of(new ExplainType(ExplainType.Type.LOGICAL))));
  assertStatement("EXPLAIN (TYPE LOGICAL, FORMAT TEXT) SELECT * FROM t",
      new Explain(
          simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t"))),
          false,
          false,
          ImmutableList.of(
              new ExplainType(ExplainType.Type.LOGICAL),
              new ExplainFormat(ExplainFormat.Type.TEXT))));
}
com.facebook.presto.sql.treeExplainType<init>

Popular methods of ExplainType

  • getType

Popular in Java

  • Making http post requests using okhttp
  • setRequestProperty (URLConnection)
  • getSystemService (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • 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