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


Java NullDirection.FIRST属性代码示例

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


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

示例1: nullsSortHigh

/**
 * Reports whether NULL sorts high or low in this ordering.
 *
 * @return
 * {@code true}  if NULL sorts higher than any other value;
 * {@code false} if NULL sorts lower  than any other value
 */
public boolean nullsSortHigh() {
  final boolean nullsHigh;

  switch (nullOrdering) {

  case UNSPECIFIED:
    // Default:  NULL sorts high: like NULLS LAST if ASC, FIRST if DESC.
    nullsHigh = true;
    break;

  case FIRST:
    // FIRST: NULL sorts low with ASC, high with DESC.
    nullsHigh = Direction.DESCENDING == getDirection();
    break;

  case LAST:
    // LAST: NULL sorts high with ASC, low with DESC.
    nullsHigh = Direction.ASCENDING == getDirection();
    break;

  default:
    throw new DrillRuntimeException(
        "Unexpected " + NullDirection.class.getName() + " value other than "
        + NullDirection.FIRST + ", " + NullDirection.LAST + " or " + NullDirection.UNSPECIFIED + ": "
        + nullOrdering );
  }

  return nullsHigh;
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:36,代码来源:Order.java

示例2: test_Ordering_roundTripAscAndNullsFirst

@Test
public void test_Ordering_roundTripAscAndNullsFirst() {
  Ordering src = new Ordering( Direction.ASCENDING, null, NullDirection.FIRST);
  Ordering reconstituted =
      new Ordering( (LogicalExpression) null, src.getOrder(), src.getNullDirection().toString() );
  assertThat( reconstituted.getDirection(), equalTo( RelFieldCollation.Direction.ASCENDING  ) );
  assertThat( reconstituted.getNullDirection(), equalTo( NullDirection.FIRST  ) );
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:8,代码来源:OrderTest.java

示例3: nullsSortHigh

/**
 * Reports whether NULL sorts high or low in this ordering.
 *
 * @return
 * {@code true}  if NULL sorts higher than any other value;
 * {@code false} if NULL sorts lower  than any other value
 */
public boolean nullsSortHigh() {
  final boolean nullsHigh;

  switch (nullOrdering) {

  case UNSPECIFIED:
    // Default:  NULL sorts high: like NULLS LAST if ASC, FIRST if DESC.
    nullsHigh = true;
    break;

  case FIRST:
    // FIRST: NULL sorts low with ASC, high with DESC.
    nullsHigh = Direction.DESCENDING == getDirection();
    break;

  case LAST:
    // LAST: NULL sorts high with ASC, low with DESC.
    nullsHigh = Direction.ASCENDING == getDirection();
    break;

  default:
    throw new RuntimeException(
        "Unexpected " + NullDirection.class.getName() + " value other than "
        + NullDirection.FIRST + ", " + NullDirection.LAST + " or " + NullDirection.UNSPECIFIED + ": "
        + nullOrdering );
  }

  return nullsHigh;
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:36,代码来源:Order.java

示例4: test_Ordering_roundTripAscAndNullsFirst

@Test
public void test_Ordering_roundTripAscAndNullsFirst() {
  Ordering src = new Ordering( Direction.ASCENDING, null, NullDirection.FIRST);
  Ordering reconstituted =
      new Ordering( src.getDirection(), (LogicalExpression) null, src.getNullDirection() );
  assertThat( reconstituted.getDirection(), equalTo( RelFieldCollation.Direction.ASCENDING  ) );
  assertThat( reconstituted.getNullDirection(), equalTo( NullDirection.FIRST  ) );
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:8,代码来源:OrderTest.java

示例5: Ordering

public Ordering(Direction direction, LogicalExpression e) {
  this(direction, e, NullDirection.FIRST);
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:3,代码来源:Order.java


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