You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "clintropolis (via GitHub)" <gi...@apache.org> on 2024/01/04 04:47:31 UTC
Re: [PR] Web console: use arrayIngestMode: array (druid)
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org