APISonar


com.dremio.dac.proto.model.dataset.DataType.TIME

> com > dremio > dac > proto > model > dataset > DataType > TIME
com APIs dremio APIs dac APIs proto APIs model APIs dataset APIs DataType APIs TIME APIs

Example 1
private String quoteLiteral(String value, DataType type) {
    if (type == DataType.TEXT) {
      return stringLiteral(value);
    } else if (type == DataType.DATE) {
      return "DATE " + stringLiteral(value);
    } else if (type == DataType.TIME) {
      return "TIME " + stringLiteral(value);
    } else if (type == DataType.DATETIME) {
      return "TIMESTAMP " + stringLiteral(value);
    }

    return value;
  }
Example 2
public void testSelectionCount() {
    testSelectionCountHelper("colName = 'val1'", 1562383L, DataType.TEXT, ImmutableSet.of("val1"));
    testSelectionCountHelper("colName = 'val1' OR colName = 'val2'", 1562L, DataType.TEXT, ImmutableSet.of("val1", "val2"));
    Set<String> selectedValues = new LinkedHashSet<>(Arrays.asList("val1", null));
    testSelectionCountHelper("colName = 'val1' OR colName IS NULL", 1562L, DataType.TEXT, selectedValues);
    testSelectionCountHelper("colName = 1 OR colName = 2", 15432L, DataType.INTEGER, ImmutableSet.of("1", "2"));
    testSelectionCountHelper("colName = DATE '2017-05-03' OR colName = DATE '2035-12-12'",
        23L, DataType.DATE, ImmutableSet.of("2017-05-03", "2035-12-12"));
    testSelectionCountHelper("colName = TIMESTAMP '2017-05-03 12:23:24' OR colName = TIMESTAMP '2035-12-12 05:23:23'",
        2L, DataType.DATETIME, ImmutableSet.of("2017-05-03 12:23:24", "2035-12-12 05:23:23"));
    testSelectionCountHelper("colName = TIME '12:23:24' OR colName = TIME '05:23:23'",
        6L, DataType.TIME, ImmutableSet.of("12:23:24", "05:23:23"));
    testSelectionCountHelper("colName = ''", 1562383L, DataType.TEXT, ImmutableSet.of(""));
    testSelectionCountHelper(null, 0L, DataType.INTEGER, ImmutableSet.<String>of());
  }