@malloydata/malloy 0.0.24-dev230224214106 → 0.0.24-dev230228224434
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/connection_utils.js +10 -10
- package/dist/dialect/dialect.d.ts +2 -2
- package/dist/dialect/dialect.js +13 -13
- package/dist/dialect/dialect_map.d.ts +1 -1
- package/dist/dialect/duckdb.d.ts +3 -3
- package/dist/dialect/duckdb.js +44 -44
- package/dist/dialect/index.d.ts +6 -6
- package/dist/dialect/postgres.d.ts +3 -3
- package/dist/dialect/postgres.js +46 -46
- package/dist/dialect/standardsql.d.ts +4 -4
- package/dist/dialect/standardsql.js +51 -51
- package/dist/index.d.ts +10 -10
- package/dist/lang/ast/ast-utils.d.ts +1 -1
- package/dist/lang/ast/ast-utils.js +3 -3
- package/dist/lang/ast/elements/define-query.d.ts +3 -3
- package/dist/lang/ast/elements/define-query.js +6 -6
- package/dist/lang/ast/elements/define-source.d.ts +4 -4
- package/dist/lang/ast/elements/define-source.js +8 -8
- package/dist/lang/ast/elements/import-statement.d.ts +2 -2
- package/dist/lang/ast/elements/import-statement.js +7 -7
- package/dist/lang/ast/elements/pipeline-desc.d.ts +5 -5
- package/dist/lang/ast/elements/pipeline-desc.js +11 -11
- package/dist/lang/ast/elements/refined-source.d.ts +4 -4
- package/dist/lang/ast/elements/refined-source.js +6 -6
- package/dist/lang/ast/elements/source.d.ts +3 -3
- package/dist/lang/ast/elements/source.js +1 -1
- package/dist/lang/ast/error-factory.d.ts +1 -1
- package/dist/lang/ast/error-factory.js +15 -15
- package/dist/lang/ast/executors/index-executor.d.ts +7 -7
- package/dist/lang/ast/executors/index-executor.js +4 -4
- package/dist/lang/ast/executors/project-executor.d.ts +5 -5
- package/dist/lang/ast/executors/project-executor.js +2 -2
- package/dist/lang/ast/executors/reduce-executor.d.ts +8 -8
- package/dist/lang/ast/executors/reduce-executor.js +5 -5
- package/dist/lang/ast/expressions/apply.d.ts +2 -2
- package/dist/lang/ast/expressions/apply.js +1 -1
- package/dist/lang/ast/expressions/binary-boolean.d.ts +3 -3
- package/dist/lang/ast/expressions/binary-boolean.js +6 -6
- package/dist/lang/ast/expressions/binary-numeric.d.ts +3 -3
- package/dist/lang/ast/expressions/binary-numeric.js +2 -2
- package/dist/lang/ast/expressions/boolean.d.ts +4 -4
- package/dist/lang/ast/expressions/boolean.js +2 -2
- package/dist/lang/ast/expressions/constant-sub-expression.d.ts +4 -4
- package/dist/lang/ast/expressions/constant-sub-expression.js +12 -12
- package/dist/lang/ast/expressions/expr-add-sub.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-add-sub.js +1 -1
- package/dist/lang/ast/expressions/expr-aggregate-function.d.ts +5 -5
- package/dist/lang/ast/expressions/expr-aggregate-function.js +15 -15
- package/dist/lang/ast/expressions/expr-alternation-tree.d.ts +6 -6
- package/dist/lang/ast/expressions/expr-alternation-tree.js +6 -6
- package/dist/lang/ast/expressions/expr-asymmetric.d.ts +5 -5
- package/dist/lang/ast/expressions/expr-asymmetric.js +3 -3
- package/dist/lang/ast/expressions/expr-avg.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-avg.js +2 -2
- package/dist/lang/ast/expressions/expr-cast.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-cast.js +6 -6
- package/dist/lang/ast/expressions/expr-compare.d.ts +5 -5
- package/dist/lang/ast/expressions/expr-compare.js +9 -9
- package/dist/lang/ast/expressions/expr-count-distinct.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-count-distinct.js +1 -1
- package/dist/lang/ast/expressions/expr-count.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-count.js +10 -10
- package/dist/lang/ast/expressions/expr-filter.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-filter.js +13 -13
- package/dist/lang/ast/expressions/expr-func.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-func.js +8 -8
- package/dist/lang/ast/expressions/expr-granular-time.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-granular-time.js +17 -17
- package/dist/lang/ast/expressions/expr-id-reference.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-id-reference.js +11 -11
- package/dist/lang/ast/expressions/expr-logical-op.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-logical-op.js +1 -1
- package/dist/lang/ast/expressions/expr-max.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-max.js +1 -1
- package/dist/lang/ast/expressions/expr-min.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-min.js +1 -1
- package/dist/lang/ast/expressions/expr-minus.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-minus.js +5 -5
- package/dist/lang/ast/expressions/expr-mul-div.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-mul-div.js +1 -1
- package/dist/lang/ast/expressions/expr-not.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-not.js +3 -3
- package/dist/lang/ast/expressions/expr-now.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-now.js +8 -8
- package/dist/lang/ast/expressions/expr-null.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-null.js +4 -4
- package/dist/lang/ast/expressions/expr-number.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-number.js +2 -2
- package/dist/lang/ast/expressions/expr-parens.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-parens.js +3 -3
- package/dist/lang/ast/expressions/expr-regex.d.ts +2 -2
- package/dist/lang/ast/expressions/expr-regex.js +4 -4
- package/dist/lang/ast/expressions/expr-string.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-string.js +8 -8
- package/dist/lang/ast/expressions/expr-sum.d.ts +3 -3
- package/dist/lang/ast/expressions/expr-sum.js +2 -2
- package/dist/lang/ast/expressions/expr-time-extract.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-time-extract.js +30 -30
- package/dist/lang/ast/expressions/expr-time.d.ts +4 -4
- package/dist/lang/ast/expressions/expr-time.js +10 -10
- package/dist/lang/ast/expressions/expr-ungroup.d.ts +6 -6
- package/dist/lang/ast/expressions/expr-ungroup.js +13 -13
- package/dist/lang/ast/expressions/for-range.d.ts +4 -4
- package/dist/lang/ast/expressions/for-range.js +17 -17
- package/dist/lang/ast/expressions/granular-literal.d.ts +4 -4
- package/dist/lang/ast/expressions/granular-literal.js +34 -34
- package/dist/lang/ast/expressions/partial-compare.d.ts +4 -4
- package/dist/lang/ast/expressions/partial-compare.js +4 -4
- package/dist/lang/ast/expressions/pick-when.d.ts +4 -4
- package/dist/lang/ast/expressions/pick-when.js +32 -32
- package/dist/lang/ast/expressions/range.d.ts +3 -3
- package/dist/lang/ast/expressions/range.js +20 -20
- package/dist/lang/ast/expressions/time-frame.d.ts +2 -2
- package/dist/lang/ast/expressions/time-frame.js +3 -3
- package/dist/lang/ast/expressions/top-by.d.ts +4 -4
- package/dist/lang/ast/expressions/top-by.js +5 -5
- package/dist/lang/ast/expressions/unary.d.ts +1 -1
- package/dist/lang/ast/expressions/unary.js +1 -1
- package/dist/lang/ast/expressions/utils.d.ts +2 -2
- package/dist/lang/ast/expressions/utils.js +6 -6
- package/dist/lang/ast/field-space/column-space-field.d.ts +3 -3
- package/dist/lang/ast/field-space/dynamic-space.d.ts +7 -7
- package/dist/lang/ast/field-space/dynamic-space.js +2 -2
- package/dist/lang/ast/field-space/field-definition-value.d.ts +5 -5
- package/dist/lang/ast/field-space/index-field-space.d.ts +3 -3
- package/dist/lang/ast/field-space/index-field-space.js +4 -4
- package/dist/lang/ast/field-space/join-space-field.d.ts +3 -3
- package/dist/lang/ast/field-space/project-field-space.d.ts +2 -2
- package/dist/lang/ast/field-space/project-field-space.js +5 -5
- package/dist/lang/ast/field-space/query-field-struct.d.ts +3 -3
- package/dist/lang/ast/field-space/query-field-struct.js +1 -1
- package/dist/lang/ast/field-space/query-space-field.d.ts +4 -4
- package/dist/lang/ast/field-space/query-space-field.js +1 -1
- package/dist/lang/ast/field-space/query-spaces.d.ts +11 -11
- package/dist/lang/ast/field-space/query-spaces.js +8 -8
- package/dist/lang/ast/field-space/reference-field.d.ts +5 -5
- package/dist/lang/ast/field-space/reference-field.js +1 -1
- package/dist/lang/ast/field-space/refined-space.d.ts +4 -4
- package/dist/lang/ast/field-space/refined-space.js +2 -2
- package/dist/lang/ast/field-space/rename-space-field.d.ts +3 -3
- package/dist/lang/ast/field-space/rename-space-field.js +2 -2
- package/dist/lang/ast/field-space/static-space.d.ts +7 -7
- package/dist/lang/ast/field-space/static-space.js +12 -12
- package/dist/lang/ast/field-space/struct-space-field-base.d.ts +4 -4
- package/dist/lang/ast/field-space/struct-space-field-base.js +1 -1
- package/dist/lang/ast/field-space/wild-space-field.d.ts +4 -4
- package/dist/lang/ast/field-space/wild-space-field.js +1 -1
- package/dist/lang/ast/fragtype-utils.d.ts +1 -1
- package/dist/lang/ast/fragtype-utils.js +15 -15
- package/dist/lang/ast/index.d.ts +90 -90
- package/dist/lang/ast/parameters/constant-parameter.d.ts +3 -3
- package/dist/lang/ast/parameters/constant-parameter.js +10 -10
- package/dist/lang/ast/parameters/has-parameter.d.ts +3 -3
- package/dist/lang/ast/parameters/has-parameter.js +7 -7
- package/dist/lang/ast/query-elements/anonymous-query.d.ts +3 -3
- package/dist/lang/ast/query-elements/anonymous-query.js +2 -2
- package/dist/lang/ast/query-elements/existing-query.d.ts +4 -4
- package/dist/lang/ast/query-elements/existing-query.js +10 -10
- package/dist/lang/ast/query-elements/full-query.d.ts +4 -4
- package/dist/lang/ast/query-elements/full-query.js +10 -10
- package/dist/lang/ast/query-elements/query-head-struct.d.ts +2 -2
- package/dist/lang/ast/query-elements/query-head-struct.js +2 -2
- package/dist/lang/ast/query-items/field-declaration.d.ts +6 -6
- package/dist/lang/ast/query-items/field-declaration.js +14 -14
- package/dist/lang/ast/query-items/field-references.d.ts +6 -6
- package/dist/lang/ast/query-items/field-references.js +9 -9
- package/dist/lang/ast/query-properties/aggregate.d.ts +2 -2
- package/dist/lang/ast/query-properties/aggregate.js +1 -1
- package/dist/lang/ast/query-properties/declare-fields.d.ts +2 -2
- package/dist/lang/ast/query-properties/declare-fields.js +1 -1
- package/dist/lang/ast/query-properties/dimmensions.d.ts +2 -2
- package/dist/lang/ast/query-properties/dimmensions.js +1 -1
- package/dist/lang/ast/query-properties/filters.d.ts +4 -4
- package/dist/lang/ast/query-properties/filters.js +16 -16
- package/dist/lang/ast/query-properties/group-by.d.ts +2 -2
- package/dist/lang/ast/query-properties/group-by.js +1 -1
- package/dist/lang/ast/query-properties/indexing.d.ts +3 -3
- package/dist/lang/ast/query-properties/indexing.js +3 -3
- package/dist/lang/ast/query-properties/joins.d.ts +6 -6
- package/dist/lang/ast/query-properties/joins.js +27 -27
- package/dist/lang/ast/query-properties/limit.d.ts +1 -1
- package/dist/lang/ast/query-properties/limit.js +1 -1
- package/dist/lang/ast/query-properties/measures.d.ts +2 -2
- package/dist/lang/ast/query-properties/measures.js +1 -1
- package/dist/lang/ast/query-properties/nest-reference.d.ts +2 -2
- package/dist/lang/ast/query-properties/nest-reference.js +1 -1
- package/dist/lang/ast/query-properties/nest.d.ts +7 -7
- package/dist/lang/ast/query-properties/nest.js +7 -7
- package/dist/lang/ast/query-properties/nests.d.ts +2 -2
- package/dist/lang/ast/query-properties/nests.js +1 -1
- package/dist/lang/ast/query-properties/ordering.d.ts +3 -3
- package/dist/lang/ast/query-properties/ordering.js +6 -6
- package/dist/lang/ast/query-properties/project-statement.d.ts +2 -2
- package/dist/lang/ast/query-properties/project-statement.js +1 -1
- package/dist/lang/ast/query-properties/qop-desc.d.ts +7 -7
- package/dist/lang/ast/query-properties/qop-desc.js +20 -20
- package/dist/lang/ast/query-properties/sampling.d.ts +2 -2
- package/dist/lang/ast/query-properties/sampling.js +1 -1
- package/dist/lang/ast/query-properties/top.d.ts +4 -4
- package/dist/lang/ast/query-properties/top.js +5 -5
- package/dist/lang/ast/source-properties/field-list-edit.d.ts +4 -4
- package/dist/lang/ast/source-properties/field-list-edit.js +2 -2
- package/dist/lang/ast/source-properties/primary-key.d.ts +2 -2
- package/dist/lang/ast/source-properties/primary-key.js +2 -2
- package/dist/lang/ast/source-properties/renames.d.ts +2 -2
- package/dist/lang/ast/source-properties/renames.js +3 -3
- package/dist/lang/ast/source-properties/turtles.d.ts +2 -2
- package/dist/lang/ast/source-properties/turtles.js +1 -1
- package/dist/lang/ast/sources/named-source.d.ts +4 -4
- package/dist/lang/ast/sources/named-source.js +5 -5
- package/dist/lang/ast/sources/query-source.d.ts +3 -3
- package/dist/lang/ast/sources/query-source.js +3 -3
- package/dist/lang/ast/sources/sql-source.d.ts +2 -2
- package/dist/lang/ast/sources/sql-source.js +2 -2
- package/dist/lang/ast/sources/table-source.d.ts +2 -2
- package/dist/lang/ast/sources/table-source.js +7 -7
- package/dist/lang/ast/space-seed.d.ts +2 -2
- package/dist/lang/ast/space-seed.js +1 -1
- package/dist/lang/ast/sql-elements/sql-statement.d.ts +4 -4
- package/dist/lang/ast/sql-elements/sql-statement.js +9 -9
- package/dist/lang/ast/sql-elements/sql-string.d.ts +3 -3
- package/dist/lang/ast/sql-elements/sql-string.js +6 -6
- package/dist/lang/ast/struct-utils.d.ts +2 -2
- package/dist/lang/ast/struct-utils.js +3 -3
- package/dist/lang/ast/time-utils.d.ts +6 -6
- package/dist/lang/ast/time-utils.js +46 -46
- package/dist/lang/ast/types/document-compile-result.d.ts +2 -2
- package/dist/lang/ast/types/executor.d.ts +3 -3
- package/dist/lang/ast/types/explore-desc.d.ts +2 -2
- package/dist/lang/ast/types/explore-desc.js +1 -1
- package/dist/lang/ast/types/explore-field.d.ts +3 -3
- package/dist/lang/ast/types/expr-result.d.ts +2 -2
- package/dist/lang/ast/types/expr-value.d.ts +2 -2
- package/dist/lang/ast/types/expression-def.d.ts +4 -4
- package/dist/lang/ast/types/expression-def.js +86 -86
- package/dist/lang/ast/types/field-collection-member.d.ts +3 -3
- package/dist/lang/ast/types/field-decl.d.ts +5 -5
- package/dist/lang/ast/types/field-space.d.ts +5 -5
- package/dist/lang/ast/types/field-space.js +1 -1
- package/dist/lang/ast/types/granular-result.d.ts +3 -3
- package/dist/lang/ast/types/granular-result.js +1 -1
- package/dist/lang/ast/types/lookup-result.d.ts +1 -1
- package/dist/lang/ast/types/malloy-element.d.ts +6 -6
- package/dist/lang/ast/types/malloy-element.js +49 -49
- package/dist/lang/ast/types/model-entry.d.ts +1 -1
- package/dist/lang/ast/types/name-space.d.ts +1 -1
- package/dist/lang/ast/types/nested-query.d.ts +2 -2
- package/dist/lang/ast/types/op-desc.d.ts +2 -2
- package/dist/lang/ast/types/query-comp.d.ts +1 -1
- package/dist/lang/ast/types/query-element.d.ts +3 -3
- package/dist/lang/ast/types/query-item.d.ts +4 -4
- package/dist/lang/ast/types/query-property.d.ts +15 -15
- package/dist/lang/ast/types/source-property.d.ts +8 -8
- package/dist/lang/ast/types/space-entry.d.ts +2 -2
- package/dist/lang/ast/types/space-field.d.ts +4 -4
- package/dist/lang/ast/types/space-field.js +4 -4
- package/dist/lang/ast/types/space-param.d.ts +4 -4
- package/dist/lang/ast/types/space-param.js +4 -4
- package/dist/lang/ast/types/time-result.d.ts +2 -2
- package/dist/lang/ast/types/turtle-headed-pipe.d.ts +2 -2
- package/dist/lang/ast/types/turtle-headed-pipe.js +1 -1
- package/dist/lang/ast/types/type-desc.d.ts +3 -3
- package/dist/lang/field-utils.d.ts +1 -1
- package/dist/lang/field-utils.js +4 -4
- package/dist/lang/index.d.ts +10 -10
- package/dist/lang/malloy-to-ast.d.ts +8 -8
- package/dist/lang/malloy-to-ast.js +68 -68
- package/dist/lang/parse-error-handler.d.ts +3 -3
- package/dist/lang/parse-error-handler.js +4 -4
- package/dist/lang/parse-log.d.ts +2 -2
- package/dist/lang/parse-log.js +1 -1
- package/dist/lang/parse-malloy.d.ts +7 -7
- package/dist/lang/parse-malloy.js +81 -81
- package/dist/lang/parse-tree-walkers/document-completion-walker.d.ts +2 -2
- package/dist/lang/parse-tree-walkers/document-completion-walker.js +38 -38
- package/dist/lang/parse-tree-walkers/document-help-context-walker.d.ts +1 -1
- package/dist/lang/parse-tree-walkers/document-help-context-walker.js +14 -14
- package/dist/lang/parse-tree-walkers/document-highlight-walker.d.ts +3 -3
- package/dist/lang/parse-tree-walkers/document-highlight-walker.js +85 -85
- package/dist/lang/parse-tree-walkers/document-symbol-walker.d.ts +4 -4
- package/dist/lang/parse-tree-walkers/document-symbol-walker.js +40 -40
- package/dist/lang/parse-tree-walkers/explore-query-walker.d.ts +3 -3
- package/dist/lang/parse-tree-walkers/explore-query-walker.js +3 -3
- package/dist/lang/parse-tree-walkers/find-external-references.d.ts +4 -4
- package/dist/lang/parse-tree-walkers/find-external-references.js +2 -2
- package/dist/lang/reference-list.d.ts +1 -1
- package/dist/lang/test/document-help-context-walker.spec.js +9 -9
- package/dist/lang/test/document-symbol-walker.spec.js +32 -32
- package/dist/lang/test/field-symbols.spec.js +87 -87
- package/dist/lang/test/parse.spec.d.ts +1 -1
- package/dist/lang/test/parse.spec.js +768 -768
- package/dist/lang/test/test-translator.d.ts +6 -6
- package/dist/lang/test/test-translator.js +159 -159
- package/dist/lang/translate-response.d.ts +7 -7
- package/dist/lang/translate-response.js +1 -1
- package/dist/lang/zone.d.ts +5 -5
- package/dist/lang/zone.js +8 -8
- package/dist/malloy.d.ts +7 -7
- package/dist/malloy.js +192 -192
- package/dist/model/index.d.ts +2 -2
- package/dist/model/malloy_query.d.ts +12 -12
- package/dist/model/malloy_query.js +497 -502
- package/dist/model/malloy_types.d.ts +68 -68
- package/dist/model/malloy_types.js +102 -102
- package/dist/model/sql_block.d.ts +1 -1
- package/dist/model/sql_block.js +4 -4
- package/dist/model/utils.d.ts +1 -1
- package/dist/model/utils.js +10 -10
- package/dist/runtime_types.d.ts +2 -2
- package/package.json +4 -1
|
@@ -31,169 +31,169 @@ const space_param_1 = require("../ast/types/space-param");
|
|
|
31
31
|
** A set of tests to make sure structdefs can become fieldspaces
|
|
32
32
|
** and the fieldspace produces the same strcutdef
|
|
33
33
|
*/
|
|
34
|
-
describe(
|
|
34
|
+
describe('structdef comprehension', () => {
|
|
35
35
|
function mkStructDef(field) {
|
|
36
36
|
return {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
type: 'struct',
|
|
38
|
+
name: 'test',
|
|
39
|
+
dialect: 'standardsql',
|
|
40
|
+
structSource: { type: 'table', tablePath: 'test' },
|
|
41
|
+
structRelationship: { type: 'basetable', connectionName: 'test' },
|
|
42
|
+
fields: [field],
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
function fieldRef(fieldPath) {
|
|
46
|
-
return fieldPath.split(
|
|
46
|
+
return fieldPath.split('.').map(name => new field_space_1.FieldName(name));
|
|
47
47
|
}
|
|
48
|
-
test(
|
|
48
|
+
test('import string field', () => {
|
|
49
49
|
const field = {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
name: 't',
|
|
51
|
+
type: 'string',
|
|
52
52
|
};
|
|
53
53
|
const struct = mkStructDef(field);
|
|
54
54
|
const space = new static_space_1.StaticSpace(struct);
|
|
55
|
-
expect(space.lookup(fieldRef(
|
|
55
|
+
expect(space.lookup(fieldRef('t')).found).toBeInstanceOf(column_space_field_1.ColumnSpaceField);
|
|
56
56
|
const oField = space.structDef().fields[0];
|
|
57
57
|
expect(oField).toEqual(field);
|
|
58
58
|
});
|
|
59
|
-
test(
|
|
59
|
+
test('import float field', () => {
|
|
60
60
|
const field = {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
name: 't',
|
|
62
|
+
type: 'number',
|
|
63
|
+
numberType: 'float',
|
|
64
64
|
};
|
|
65
65
|
const struct = mkStructDef(field);
|
|
66
66
|
const space = new static_space_1.StaticSpace(struct);
|
|
67
|
-
expect(space.lookup(fieldRef(
|
|
67
|
+
expect(space.lookup(fieldRef('t')).found).toBeInstanceOf(column_space_field_1.ColumnSpaceField);
|
|
68
68
|
const oField = space.structDef().fields[0];
|
|
69
69
|
expect(oField).toEqual(field);
|
|
70
70
|
});
|
|
71
|
-
test(
|
|
71
|
+
test('import integer field', () => {
|
|
72
72
|
const field = {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
name: 't',
|
|
74
|
+
type: 'number',
|
|
75
|
+
numberType: 'integer',
|
|
76
76
|
};
|
|
77
77
|
const struct = mkStructDef(field);
|
|
78
78
|
const space = new static_space_1.StaticSpace(struct);
|
|
79
|
-
expect(space.lookup(fieldRef(
|
|
79
|
+
expect(space.lookup(fieldRef('t')).found).toBeInstanceOf(column_space_field_1.ColumnSpaceField);
|
|
80
80
|
const oField = space.structDef().fields[0];
|
|
81
81
|
expect(oField).toEqual(field);
|
|
82
82
|
});
|
|
83
|
-
test(
|
|
83
|
+
test('import boolean field', () => {
|
|
84
84
|
const field = {
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
name: 't',
|
|
86
|
+
type: 'boolean',
|
|
87
87
|
};
|
|
88
88
|
const struct = mkStructDef(field);
|
|
89
89
|
const space = new static_space_1.StaticSpace(struct);
|
|
90
|
-
expect(space.lookup(fieldRef(
|
|
90
|
+
expect(space.lookup(fieldRef('t')).found).toBeInstanceOf(column_space_field_1.ColumnSpaceField);
|
|
91
91
|
const oField = space.structDef().fields[0];
|
|
92
92
|
expect(oField).toEqual(field);
|
|
93
93
|
});
|
|
94
|
-
test(
|
|
94
|
+
test('import unsupported field', () => {
|
|
95
95
|
const field = {
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
name: 't',
|
|
97
|
+
type: 'unsupported',
|
|
98
98
|
};
|
|
99
99
|
const struct = mkStructDef(field);
|
|
100
100
|
const space = new static_space_1.StaticSpace(struct);
|
|
101
|
-
expect(space.lookup(fieldRef(
|
|
101
|
+
expect(space.lookup(fieldRef('t')).found).toBeInstanceOf(column_space_field_1.ColumnSpaceField);
|
|
102
102
|
const oField = space.structDef().fields[0];
|
|
103
103
|
expect(oField).toEqual(field);
|
|
104
104
|
});
|
|
105
|
-
test(
|
|
105
|
+
test('import nested field', () => {
|
|
106
106
|
const field = {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
107
|
+
name: 't',
|
|
108
|
+
type: 'struct',
|
|
109
|
+
dialect: 'standardsql',
|
|
110
|
+
structRelationship: {
|
|
111
|
+
type: 'nested',
|
|
112
|
+
field: 'a',
|
|
113
|
+
isArray: false,
|
|
114
114
|
},
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
structSource: { type: 'nested' },
|
|
116
|
+
fields: [{ type: 'string', name: 'b' }],
|
|
117
117
|
};
|
|
118
118
|
const struct = mkStructDef(field);
|
|
119
119
|
const space = new static_space_1.StaticSpace(struct);
|
|
120
|
-
expect(space.lookup(fieldRef(
|
|
120
|
+
expect(space.lookup(fieldRef('t.b')).found).toBeInstanceOf(column_space_field_1.ColumnSpaceField);
|
|
121
121
|
const oField = space.structDef().fields[0];
|
|
122
122
|
expect(oField).toEqual(field);
|
|
123
123
|
});
|
|
124
|
-
test(
|
|
124
|
+
test('import inline field', () => {
|
|
125
125
|
const field = {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
126
|
+
name: 't',
|
|
127
|
+
type: 'struct',
|
|
128
|
+
dialect: 'standardsql',
|
|
129
|
+
structRelationship: { type: 'inline' },
|
|
130
|
+
structSource: { type: 'inline' },
|
|
131
|
+
fields: [{ type: 'string', name: 'a' }],
|
|
132
132
|
};
|
|
133
133
|
const struct = mkStructDef(field);
|
|
134
134
|
const space = new static_space_1.StaticSpace(struct);
|
|
135
|
-
expect(space.lookup(fieldRef(
|
|
135
|
+
expect(space.lookup(fieldRef('t.a')).found).toBeInstanceOf(column_space_field_1.ColumnSpaceField);
|
|
136
136
|
const oField = space.structDef().fields[0];
|
|
137
137
|
expect(oField).toEqual(field);
|
|
138
138
|
});
|
|
139
|
-
test(
|
|
139
|
+
test('import join field', () => {
|
|
140
140
|
const field = {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
{
|
|
148
|
-
|
|
149
|
-
{
|
|
150
|
-
]
|
|
141
|
+
name: 't',
|
|
142
|
+
type: 'struct',
|
|
143
|
+
dialect: 'standardsql',
|
|
144
|
+
structRelationship: {
|
|
145
|
+
type: 'one',
|
|
146
|
+
onExpression: [
|
|
147
|
+
{ type: 'field', path: 'aKey' },
|
|
148
|
+
'=',
|
|
149
|
+
{ type: 'field', path: 't.a' },
|
|
150
|
+
],
|
|
151
151
|
},
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
structSource: { type: 'table', tablePath: 't' },
|
|
153
|
+
fields: [{ type: 'string', name: 'a' }],
|
|
154
154
|
};
|
|
155
155
|
const struct = mkStructDef(field);
|
|
156
156
|
const space = new static_space_1.StaticSpace(struct);
|
|
157
|
-
expect(space.lookup(fieldRef(
|
|
157
|
+
expect(space.lookup(fieldRef('t.a')).found).toBeInstanceOf(column_space_field_1.ColumnSpaceField);
|
|
158
158
|
const oField = space.structDef().fields[0];
|
|
159
159
|
expect(oField).toEqual(field);
|
|
160
160
|
});
|
|
161
|
-
test(
|
|
161
|
+
test('import query stage field', () => {
|
|
162
162
|
const field = {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
name: 't',
|
|
164
|
+
type: 'turtle',
|
|
165
|
+
pipeline: [
|
|
166
166
|
{
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
]
|
|
167
|
+
type: 'reduce',
|
|
168
|
+
fields: ['a'],
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
171
|
};
|
|
172
172
|
const struct = mkStructDef(field);
|
|
173
173
|
const space = new static_space_1.StaticSpace(struct);
|
|
174
|
-
expect(space.lookup(fieldRef(
|
|
174
|
+
expect(space.lookup(fieldRef('t')).found).toBeInstanceOf(query_field_struct_1.QueryFieldStruct);
|
|
175
175
|
const oField = space.structDef().fields[0];
|
|
176
176
|
expect(oField).toEqual(field);
|
|
177
177
|
});
|
|
178
|
-
test(
|
|
179
|
-
const struct = mkStructDef({
|
|
178
|
+
test('import struct with parameters', () => {
|
|
179
|
+
const struct = mkStructDef({ name: 'f', type: 'string' });
|
|
180
180
|
struct.parameters = {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
181
|
+
cReqStr: {
|
|
182
|
+
name: 'cReqStr',
|
|
183
|
+
type: 'string',
|
|
184
|
+
value: null,
|
|
185
|
+
constant: false,
|
|
186
|
+
},
|
|
187
|
+
cOptStr: {
|
|
188
|
+
name: 'cOptStr',
|
|
189
|
+
type: 'string',
|
|
190
|
+
value: ['value'],
|
|
191
|
+
constant: false,
|
|
186
192
|
},
|
|
187
|
-
"cOptStr": {
|
|
188
|
-
"name": "cOptStr",
|
|
189
|
-
"type": "string",
|
|
190
|
-
"value": ["value"],
|
|
191
|
-
"constant": false
|
|
192
|
-
}
|
|
193
193
|
};
|
|
194
194
|
const space = new static_space_1.StaticSpace(struct);
|
|
195
|
-
expect(space.lookup(fieldRef(
|
|
196
|
-
expect(space.lookup(fieldRef(
|
|
195
|
+
expect(space.lookup(fieldRef('cReqStr')).found).toBeInstanceOf(space_param_1.DefinedParameter);
|
|
196
|
+
expect(space.lookup(fieldRef('cOptStr')).found).toBeInstanceOf(space_param_1.DefinedParameter);
|
|
197
197
|
});
|
|
198
198
|
});
|
|
199
199
|
//# sourceMappingURL=field-symbols.spec.js.map
|