clintropolis commented on code in PR #15588:
URL: https://github.com/apache/druid/pull/15588#discussion_r1441260795
##########
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:
this works with any native druid type built-in type `STRING`, `LONG`,
`DOUBLE`, `FLOAT`, `ARRAY<STRING>`, `ARRAY<LONG>`, `ARRAY<DOUBLE>`
It isn't completely crazy to use 'auto' with 'castToType' for all column
types really though i'm not entirely sure we want to make that jump yet.. but
for example if you want indexes for numerical columns you should use this
instead of the classic dimension schemas, the only exception is multi-value
strings which do not exist in 'auto' (and must be ingested as ARRAY<STRING>
instead).
##########
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:
nit: any reason to leave this commented section?
--
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]