当前位置: 首页>>代码示例>>Java>>正文


Java SqlWriter.keyword方法代码示例

本文整理汇总了Java中org.apache.calcite.sql.SqlWriter.keyword方法的典型用法代码示例。如果您正苦于以下问题:Java SqlWriter.keyword方法的具体用法?Java SqlWriter.keyword怎么用?Java SqlWriter.keyword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.calcite.sql.SqlWriter的用法示例。


在下文中一共展示了SqlWriter.keyword方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override
  public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
    writer.keyword("TRAIN");
    writer.keyword("MODEL");
    mdlName.unparse(writer, leftPrec, rightPrec);
//    if (fieldList != null && fieldList.size() > 0) {
//      writer.keyword("(");
//      fieldList.get(0).unparse(writer, leftPrec, rightPrec);
//      for (int i=1; i<fieldList.size(); i++) {
//        writer.keyword(",");
//        fieldList.get(i).unparse(writer, leftPrec, rightPrec);
//      }
//      writer.keyword(")");
//    }
    if (fieldList.size() > 0) {
    	SqlHandlerUtil.unparseSqlNodeList(writer, leftPrec, rightPrec, fieldList);
	}
	if (partitionColumns.size() > 0) {
	    writer.keyword("PARTITION BY");
	    SqlHandlerUtil.unparseSqlNodeList(writer, leftPrec, rightPrec, partitionColumns);
	}
      
    writer.keyword("AS");
    query.unparse(writer, leftPrec, rightPrec);
  }
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:26,代码来源:SqlTrainModel.java

示例2: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  writer.keyword("CREATE");
  switch (SqlCreateViewType.valueOf(createViewType.toValue())) {
    case SIMPLE:
      writer.keyword("VIEW");
      break;
    case OR_REPLACE:
      writer.keyword("OR");
      writer.keyword("REPLACE");
      writer.keyword("VIEW");
      break;
    case IF_NOT_EXISTS:
      writer.keyword("VIEW");
      writer.keyword("IF");
      writer.keyword("NOT");
      writer.keyword("EXISTS");
      break;
  }
  viewName.unparse(writer, leftPrec, rightPrec);
  if (fieldList.size() > 0) {
    SqlHandlerUtil.unparseSqlNodeList(writer, leftPrec, rightPrec, fieldList);
  }
  writer.keyword("AS");
  query.unparse(writer, leftPrec, rightPrec);
}
 
开发者ID:axbaretto,项目名称:drill,代码行数:27,代码来源:SqlCreateView.java

示例3: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  writer.keyword("CREATE");
  if (isTemporary.booleanValue()) {
    writer.keyword("TEMPORARY");
  }
  writer.keyword("TABLE");
  if (tableNonExistenceCheck.booleanValue()) {
    writer.keyword("IF");
    writer.keyword("NOT");
    writer.keyword("EXISTS");
  }
  tblName.unparse(writer, leftPrec, rightPrec);
  if (fieldList.size() > 0) {
    SqlHandlerUtil.unparseSqlNodeList(writer, leftPrec, rightPrec, fieldList);
  }
  if (partitionColumns.size() > 0) {
    writer.keyword("PARTITION BY");
    SqlHandlerUtil.unparseSqlNodeList(writer, leftPrec, rightPrec, partitionColumns);
  }
  writer.keyword("AS");
  query.unparse(writer, leftPrec, rightPrec);
}
 
开发者ID:axbaretto,项目名称:drill,代码行数:24,代码来源:SqlCreateTable.java

示例4: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  name.unparse(writer, 0, 0);
  dataType.unparse(writer, 0, 0);
  if (dataType.getNullable() != null && !dataType.getNullable()) {
    writer.keyword("NOT NULL");
  }
  if (expression != null) {
    switch (strategy) {
    case VIRTUAL:
    case STORED:
      writer.keyword("AS");
      exp(writer);
      writer.keyword(strategy.name());
      break;
    case DEFAULT:
      writer.keyword("DEFAULT");
      exp(writer);
      break;
    default:
      throw new AssertionError("unexpected: " + strategy);
    }
  }
}
 
开发者ID:apache,项目名称:calcite,代码行数:24,代码来源:SqlColumnDeclaration.java

示例5: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  if (getReplace()) {
    writer.keyword("CREATE OR REPLACE");
  } else {
    writer.keyword("CREATE");
  }
  writer.keyword("VIEW");
  name.unparse(writer, leftPrec, rightPrec);
  if (columnList != null) {
    SqlWriter.Frame frame = writer.startList("(", ")");
    for (SqlNode c : columnList) {
      writer.sep(",");
      c.unparse(writer, 0, 0);
    }
    writer.endList(frame);
  }
  writer.keyword("AS");
  writer.newlineAndIndent();
  query.unparse(writer, 0, 0);
}
 
开发者ID:apache,项目名称:calcite,代码行数:21,代码来源:SqlCreateView.java

示例6: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  writer.keyword("CREATE");
  writer.keyword("MATERIALIZED VIEW");
  if (ifNotExists) {
    writer.keyword("IF NOT EXISTS");
  }
  name.unparse(writer, leftPrec, rightPrec);
  if (columnList != null) {
    SqlWriter.Frame frame = writer.startList("(", ")");
    for (SqlNode c : columnList) {
      writer.sep(",");
      c.unparse(writer, 0, 0);
    }
    writer.endList(frame);
  }
  writer.keyword("AS");
  writer.newlineAndIndent();
  query.unparse(writer, 0, 0);
}
 
开发者ID:apache,项目名称:calcite,代码行数:20,代码来源:SqlCreateMaterializedView.java

示例7: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  writer.keyword("CREATE");
  writer.keyword("TABLE");
  if (ifNotExists) {
    writer.keyword("IF NOT EXISTS");
  }
  name.unparse(writer, leftPrec, rightPrec);
  if (columnList != null) {
    SqlWriter.Frame frame = writer.startList("(", ")");
    for (SqlNode c : columnList) {
      writer.sep(",");
      c.unparse(writer, 0, 0);
    }
    writer.endList(frame);
  }
  if (query != null) {
    writer.keyword("AS");
    writer.newlineAndIndent();
    query.unparse(writer, 0, 0);
  }
}
 
开发者ID:apache,项目名称:calcite,代码行数:22,代码来源:SqlCreateTable.java

示例8: unparseCube

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
private static void unparseCube(SqlWriter writer, SqlCall call) {
  writer.keyword(call.getOperator().getName());
  final SqlWriter.Frame frame =
      writer.startList(SqlWriter.FrameTypeEnum.FUN_CALL, "(", ")");
  for (SqlNode operand : call.getOperandList()) {
    writer.sep(",");
    if (operand.getKind() == SqlKind.ROW) {
      final SqlWriter.Frame frame2 =
          writer.startList(SqlWriter.FrameTypeEnum.SIMPLE, "(", ")");
      for (SqlNode operand2 : ((SqlCall) operand).getOperandList()) {
        writer.sep(",");
        operand2.unparse(writer, 0, 0);
      }
      writer.endList(frame2);
    } else if (operand instanceof SqlNodeList
        && ((SqlNodeList) operand).size() == 0) {
      writer.keyword("()");
    } else {
      operand.unparse(writer, 0, 0);
    }
  }
  writer.endList(frame);
}
 
开发者ID:apache,项目名称:calcite,代码行数:24,代码来源:SqlRollupOperator.java

示例9: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  writer.keyword("SHOW");
  writer.keyword("SCHEMAS");
  if (likePattern != null) {
    writer.keyword("LIKE");
    likePattern.unparse(writer, leftPrec, rightPrec);
  }
  if (whereClause != null) {
    whereClause.unparse(writer, leftPrec, rightPrec);
  }
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:13,代码来源:SqlShowSchemas.java

示例10: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  writer.keyword("REFRESH");
  writer.keyword("TABLE");
  writer.keyword("METADATA");
  tblName.unparse(writer, leftPrec, rightPrec);
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:8,代码来源:SqlRefreshMetadata.java

示例11: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  writer.keyword("SHOW");
  writer.keyword("FILES");
  if (db != null) {
    db.unparse(writer, leftPrec, rightPrec);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:9,代码来源:SqlShowFiles.java

示例12: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  writer.keyword("CREATE");
  writer.keyword("TABLE");
  tblName.unparse(writer, leftPrec, rightPrec);
  if (fieldList.size() > 0) {
    SqlHandlerUtil.unparseSqlNodeList(writer, leftPrec, rightPrec, fieldList);
  }
  if (partitionColumns.size() > 0) {
    writer.keyword("PARTITION BY");
    SqlHandlerUtil.unparseSqlNodeList(writer, leftPrec, rightPrec, partitionColumns);
  }
  writer.keyword("AS");
  query.unparse(writer, leftPrec, rightPrec);
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:16,代码来源:SqlCreateTable.java

示例13: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  writer.keyword("SHOW");
  writer.keyword("TABLES");
  if (db != null) {
    db.unparse(writer, leftPrec, rightPrec);
  }
  if (likePattern != null) {
    writer.keyword("LIKE");
    likePattern.unparse(writer, leftPrec, rightPrec);
  }
  if (whereClause != null) {
    whereClause.unparse(writer, leftPrec, rightPrec);
  }
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:16,代码来源:SqlShowTables.java

示例14: unparseSqlNodeList

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
public static void unparseSqlNodeList(SqlWriter writer, int leftPrec, int rightPrec, SqlNodeList fieldList) {
  writer.keyword("(");
  fieldList.get(0).unparse(writer, leftPrec, rightPrec);
  for (int i = 1; i<fieldList.size(); i++) {
    writer.keyword(",");
    fieldList.get(i).unparse(writer, leftPrec, rightPrec);
  }
  writer.keyword(")");
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:10,代码来源:SqlHandlerUtil.java

示例15: unparse

import org.apache.calcite.sql.SqlWriter; //导入方法依赖的package包/类
@Override
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
  writer.keyword("DROP");
  writer.keyword("TABLE");
  if (tableExistenceCheck) {
    writer.keyword("IF");
    writer.keyword("EXISTS");
  }
  tableName.unparse(writer, leftPrec, rightPrec);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:11,代码来源:SqlDropTable.java


注:本文中的org.apache.calcite.sql.SqlWriter.keyword方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。