APISonar


com.dremio.service.reflection.proto.DimensionGranularity.DATE

> com > dremio > service > reflection > proto > DimensionGranularity > DATE
com APIs dremio APIs service APIs reflection APIs proto APIs DimensionGranularity APIs DATE APIs

Example 1
private static List<ReflectionDimensionField> toReflectionDimensionFields(final Iterable<ColumnStats> columns) {
    return FluentIterable.from(columns)
        .transform(new Function<ColumnStats, ReflectionDimensionField>() {
          @Nullable
          @Override
          public ReflectionDimensionField apply(final ColumnStats columnStats) {
            return new ReflectionDimensionField()
                .setName(columnStats.getField().getName())
                .setGranularity(DimensionGranularity.DATE);
          }
        })
        .toList();
  }
Example 2
private static List<LayoutDimensionFieldDescriptor> toLayoutDimensionFieldDescriptors(final List<ReflectionDimensionField> fields) {
    return FluentIterable.from(AccelerationUtils.selfOrEmpty(fields))
        .transform(new Function<ReflectionDimensionField, LayoutDimensionFieldDescriptor>() {
          @Override
          public LayoutDimensionFieldDescriptor apply(final ReflectionDimensionField input) {
            return new LayoutDimensionFieldDescriptor()
                .setName(input.getName())
                .setGranularity(input.getGranularity()== DimensionGranularity.DATE ?
                    com.dremio.service.accelerator.proto.DimensionGranularity.DATE
                    : com.dremio.service.accelerator.proto.DimensionGranularity.NORMAL);
          }
        })
        .toList();
  }
Example 3
private List<ReflectionDimensionField> toDimensionFields(List<SqlCreateReflection.NameAndGranularity> fields) {
    return FluentIterable.from(AccelerationUtils.selfOrEmpty(fields))
        .transform(new Function<SqlCreateReflection.NameAndGranularity, ReflectionDimensionField>() {
          @Nullable
          @Override
          public ReflectionDimensionField apply(@Nullable final SqlCreateReflection.NameAndGranularity input) {
            final DimensionGranularity granularity = input.getGranularity() == SqlCreateReflection.Granularity.BY_DAY ? DimensionGranularity.DATE : DimensionGranularity.NORMAL;
            return new ReflectionDimensionField()
                .setName(input.getName())
                .setGranularity(granularity);
          }
        })
        .toList();
  }