vogievetsky commented on code in PR #15588:
URL: https://github.com/apache/druid/pull/15588#discussion_r1442071487
##########
web-console/src/druid-models/dimension-spec/dimension-spec.ts:
##########
@@ -64,6 +65,12 @@ export const DIMENSION_SPEC_FIELDS: Field<DimensionSpec>[] =
[
defaultValue: 'SORTED_ARRAY',
suggestions: ['SORTED_ARRAY', 'SORTED_SET', 'ARRAY'],
},
+ {
+ name: 'castToType',
+ type: 'string',
+ defined: typeIsKnown(KNOWN_TYPES, 'auto'),
+ suggestions: [undefined, 'ARRAY<STRING>', 'ARRAY<LONG>', 'ARRAY<DOUBLE>'],
Review Comment:
When you say that `ARRAY<FLOAT> works too but is just mapped to
ARRAY<DOUBLE>` are you advocating that we add it to the suggestions? The
suggestion are not meant to be everything that works, only everything that is
somehow useful. Remember that a standard dimension spec type can be `flooooot`
(it gets mapped to `string`) but we don't want to suggest that.
Why would we not use 'auto' with 'castToType' everywhere 🤔 ? I really like
it because it let's us get away from dimension types (which have a confusing
relationship with column types).
##########
web-console/src/druid-models/external-config/external-config.ts:
##########
@@ -127,15 +126,15 @@ export function externalConfigToTableExpression(config:
ExternalConfig): SqlExpr
export function externalConfigToInitDimensions(
config: ExternalConfig,
- isArrays: boolean[],
timeExpression: SqlExpression | undefined,
): SqlExpression[] {
return (timeExpression ? [timeExpression.as('__time')] : [])
.concat(
- filterMap(config.signature, (columnDeclaration, i) => {
+ filterMap(config.signature, columnDeclaration => {
const columnName = columnDeclaration.getColumnName();
if (timeExpression && timeExpression.containsColumnName(columnName))
return;
- return C(columnName).applyIf(isArrays[i], ex => F('MV_TO_ARRAY',
ex).as(columnName) as any);
+ return C(columnName);
+ // return C(columnName).applyIf(isArrays[i], ex => F('MV_TO_ARRAY',
ex).as(columnName) as any);
Review Comment:
woops
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]