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


Java SqlOrderBy类代码示例

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


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

示例1: isOrdered

import org.apache.calcite.sql.SqlOrderBy; //导入依赖的package包/类
public static boolean isOrdered(SqlNode query) {
	switch (query.getKind()) {
		case SELECT:
			return ((SqlSelect) query).getOrderList() != null
				&& ((SqlSelect) query).getOrderList().size() > 0;
		case WITH:
			return isOrdered(((SqlWith) query).body);
		case ORDER_BY:
			return ((SqlOrderBy) query).orderList.size() > 0;
		default:
			return false;
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:14,代码来源:SqlToRelConverter.java

示例2: isOrdered

import org.apache.calcite.sql.SqlOrderBy; //导入依赖的package包/类
public static boolean isOrdered(SqlNode query) {
  switch (query.getKind()) {
  case SELECT:
    return ((SqlSelect) query).getOrderList() != null
        && ((SqlSelect) query).getOrderList().size() > 0;
  case WITH:
    return isOrdered(((SqlWith) query).body);
  case ORDER_BY:
    return ((SqlOrderBy) query).orderList.size() > 0;
  default:
    return false;
  }
}
 
开发者ID:apache,项目名称:kylin,代码行数:14,代码来源:SqlToRelConverter.java

示例3: getInnerSelect

import org.apache.calcite.sql.SqlOrderBy; //导入依赖的package包/类
private SqlSelect getInnerSelect(SqlNode node) {
  for (;;) {
    if (node instanceof SqlSelect) {
      return (SqlSelect) node;
    } else if (node instanceof SqlOrderBy) {
      node = ((SqlOrderBy) node).query;
    } else if (node instanceof SqlWith) {
      node = ((SqlWith) node).body;
    } else {
      return null;
    }
  }
}
 
开发者ID:apache,项目名称:calcite,代码行数:14,代码来源:SqlValidatorImpl.java

示例4: getFieldOrigin

import org.apache.calcite.sql.SqlOrderBy; //导入依赖的package包/类
private List<String> getFieldOrigin(SqlNode sqlQuery, int i) {
  if (sqlQuery instanceof SqlSelect) {
    SqlSelect sqlSelect = (SqlSelect) sqlQuery;
    final SelectScope scope = getRawSelectScope(sqlSelect);
    final List<SqlNode> selectList = scope.getExpandedSelectList();
    final SqlNode selectItem = stripAs(selectList.get(i));
    if (selectItem instanceof SqlIdentifier) {
      final SqlQualified qualified =
          scope.fullyQualify((SqlIdentifier) selectItem);
      SqlValidatorNamespace namespace = qualified.namespace;
      final SqlValidatorTable table = namespace.getTable();
      if (table == null) {
        return null;
      }
      final List<String> origin =
          new ArrayList<>(table.getQualifiedName());
      for (String name : qualified.suffix()) {
        namespace = namespace.lookupChild(name);
        if (namespace == null) {
          return null;
        }
        origin.add(name);
      }
      return origin;
    }
    return null;
  } else if (sqlQuery instanceof SqlOrderBy) {
    return getFieldOrigin(((SqlOrderBy) sqlQuery).query, i);
  } else {
    return null;
  }
}
 
开发者ID:apache,项目名称:calcite,代码行数:33,代码来源:SqlValidatorImpl.java

示例5: extractOrderBy

import org.apache.calcite.sql.SqlOrderBy; //导入依赖的package包/类
private VirtualDatasetState extractOrderBy(String sql, SqlNode node, final RelDataType relDataType) {
  SqlOrderBy orderBy = (SqlOrderBy)node;
  return extract(sql, orderBy.query, relDataType);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:5,代码来源:QuerySemantics.java


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