Tabnine Logo
ExplainType.getType
Code IndexAdd Tabnine to your IDE (free)

How to use
getType
method
in
com.facebook.presto.sql.tree.ExplainType

Best Java code snippets using com.facebook.presto.sql.tree.ExplainType.getType (Showing top 7 results out of 315)

origin: prestodb/presto

@Override
protected Void visitExplain(Explain node, Integer indent)
{
  builder.append("EXPLAIN ");
  if (node.isAnalyze()) {
    builder.append("ANALYZE ");
  }
  List<String> options = new ArrayList<>();
  for (ExplainOption option : node.getOptions()) {
    if (option instanceof ExplainType) {
      options.add("TYPE " + ((ExplainType) option).getType());
    }
    else if (option instanceof ExplainFormat) {
      options.add("FORMAT " + ((ExplainFormat) option).getType());
    }
    else {
      throw new UnsupportedOperationException("unhandled explain option: " + option);
    }
  }
  if (!options.isEmpty()) {
    builder.append("(");
    Joiner.on(", ").appendTo(builder, options);
    builder.append(")");
  }
  builder.append("\n");
  process(node.getStatement(), indent);
  return null;
}
origin: prestodb/presto

@Override
protected Node visitExplain(Explain node, Void context)
    throws SemanticException
{
  if (node.isAnalyze()) {
    Statement statement = (Statement) process(node.getStatement(), context);
    return new Explain(statement, node.isAnalyze(), node.isVerbose(), node.getOptions());
  }
  ExplainType.Type planType = LOGICAL;
  ExplainFormat.Type planFormat = TEXT;
  List<ExplainOption> options = node.getOptions();
  for (ExplainOption option : options) {
    if (option instanceof ExplainType) {
      planType = ((ExplainType) option).getType();
      // Use JSON as the default format for EXPLAIN (TYPE IO).
      if (planType == IO) {
        planFormat = JSON;
      }
      break;
    }
  }
  for (ExplainOption option : options) {
    if (option instanceof ExplainFormat) {
      planFormat = ((ExplainFormat) option).getType();
      break;
    }
  }
  return getQueryPlan(node, planType, planFormat);
}
origin: rakam-io/rakam

@Override
protected Void visitExplain(Explain node, Integer indent) {
  builder.append("EXPLAIN ");
  if (node.isAnalyze()) {
    builder.append("ANALYZE ");
  }
  List<String> options = new ArrayList<>();
  for (ExplainOption option : node.getOptions()) {
    if (option instanceof ExplainType) {
      options.add("TYPE " + ((ExplainType) option).getType());
    } else if (option instanceof ExplainFormat) {
      options.add("FORMAT " + ((ExplainFormat) option).getType());
    } else {
      throw new UnsupportedOperationException("unhandled explain option: " + option);
    }
  }
  if (!options.isEmpty()) {
    builder.append("(");
    Joiner.on(", ").appendTo(builder, options);
    builder.append(")");
  }
  builder.append("\n");
  process(node.getStatement(), indent);
  return null;
}
origin: vqtran/EchoQuery

@Override
protected Void visitExplain(Explain node, Integer indent)
{
  builder.append("EXPLAIN ");
  List<String> options = new ArrayList<>();
  for (ExplainOption option : node.getOptions()) {
    if (option instanceof ExplainType) {
      options.add("TYPE " + ((ExplainType) option).getType());
    }
    else if (option instanceof ExplainFormat) {
      options.add("FORMAT " + ((ExplainFormat) option).getType());
    }
    else {
      throw new UnsupportedOperationException("unhandled explain option: " + option);
    }
  }
  if (!options.isEmpty()) {
    builder.append("(");
    Joiner.on(", ").appendTo(builder, options);
    builder.append(")");
  }
  builder.append("\n");
  process(node.getStatement(), indent);
  return null;
}
origin: uk.co.nichesolutions.presto/presto-parser

@Override
protected Void visitExplain(Explain node, Integer indent)
{
  builder.append("EXPLAIN ");
  if (node.isAnalyze()) {
    builder.append("ANALYZE ");
  }
  List<String> options = new ArrayList<>();
  for (ExplainOption option : node.getOptions()) {
    if (option instanceof ExplainType) {
      options.add("TYPE " + ((ExplainType) option).getType());
    }
    else if (option instanceof ExplainFormat) {
      options.add("FORMAT " + ((ExplainFormat) option).getType());
    }
    else {
      throw new UnsupportedOperationException("unhandled explain option: " + option);
    }
  }
  if (!options.isEmpty()) {
    builder.append("(");
    Joiner.on(", ").appendTo(builder, options);
    builder.append(")");
  }
  builder.append("\n");
  process(node.getStatement(), indent);
  return null;
}
origin: com.facebook.presto/presto-parser

@Override
protected Void visitExplain(Explain node, Integer indent)
{
  builder.append("EXPLAIN ");
  if (node.isAnalyze()) {
    builder.append("ANALYZE ");
  }
  List<String> options = new ArrayList<>();
  for (ExplainOption option : node.getOptions()) {
    if (option instanceof ExplainType) {
      options.add("TYPE " + ((ExplainType) option).getType());
    }
    else if (option instanceof ExplainFormat) {
      options.add("FORMAT " + ((ExplainFormat) option).getType());
    }
    else {
      throw new UnsupportedOperationException("unhandled explain option: " + option);
    }
  }
  if (!options.isEmpty()) {
    builder.append("(");
    Joiner.on(", ").appendTo(builder, options);
    builder.append(")");
  }
  builder.append("\n");
  process(node.getStatement(), indent);
  return null;
}
origin: uk.co.nichesolutions.presto/presto-main

planType = ((ExplainType) option).getType();
break;
com.facebook.presto.sql.treeExplainTypegetType

Popular methods of ExplainType

  • <init>

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSystemService (Context)
  • getResourceAsStream (ClassLoader)
  • setRequestProperty (URLConnection)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Best IntelliJ 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