forked from SchemaStore/schemastore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomet.json
931 lines (930 loc) · 25.9 KB
/
comet.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Comet Data Pipeline",
"description": "JSOn Schema for Comet Data Pipeline",
"definitions": {
"PrimitiveType": {
"type": "string",
"oneOf": [
{
"const": "string",
"description": ""
},
{
"const": "long",
"description": ""
},
{
"const": "int",
"description": ""
},
{
"const": "short",
"description": ""
},
{
"const": "double",
"description": ""
},
{
"const": "boolean",
"description": ""
},
{
"const": "byte",
"description": ""
},
{
"const": "date",
"description": ""
},
{
"const": "timestamp",
"description": ""
},
{
"const": "decimal",
"description": ""
},
{
"const": "struct",
"description": ""
}
]
},
"IndexMapping": {
"type": "string",
"oneOf": [
{
"const": "text",
"description": ""
},
{
"const": "keyword",
"description": ""
},
{
"const": "long",
"description": ""
},
{
"const": "integer",
"description": ""
},
{
"const": "short",
"description": ""
},
{
"const": "byte",
"description": ""
},
{
"const": "double",
"description": ""
},
{
"const": "float",
"description": ""
},
{
"const": "half_float",
"description": ""
},
{
"const": "scaled_float",
"description": ""
},
{
"const": "date",
"description": ""
},
{
"const": "boolean",
"description": ""
},
{
"const": "binary",
"description": ""
},
{
"const": "integer_rang",
"description": ""
},
{
"const": "float_range",
"description": ""
},
{
"const": "long_range",
"description": ""
},
{
"const": "double_range",
"description": ""
},
{
"const": "date_range",
"description": ""
},
{
"const": "geo_point",
"description": ""
},
{
"const": "geo_shape",
"description": ""
},
{
"const": "ip",
"description": ""
},
{
"const": "completion",
"description": ""
},
{
"const": "token_count",
"description": ""
},
{
"const": "object",
"description": ""
},
{
"const": "array",
"description": ""
}
]
},
"Engine": {
"description": "SPARK or BQ. Default value is SPARK.",
"type": "string",
"oneOf": [
{
"const": "BQ",
"description": ""
},
{
"const": "SPARK",
"description": ""
}
]
},
"WriteMode": {
"description": "Append to or overwrite existing data",
"type": "string",
"oneOf": [
{
"const": "OVERWRITE",
"description": ""
},
{
"const": "APPEND",
"description": ""
},
{
"const": "ERROR_IF_EXISTS",
"description": ""
},
{
"const": "IGNORE",
"description": ""
}
]
},
"UserType": {
"type": "string",
"oneOf": [
{
"const": "SA",
"description": ""
},
{
"const": "USER",
"description": ""
},
{
"const": "GROUP",
"description": ""
}
]
},
"Trim": {
"type": "string",
"oneOf": [
{
"const": "LEFT",
"description": ""
},
{
"const": "RIGHT",
"description": ""
},
{
"const": "BOTH",
"description": ""
},
{
"const": "NONE",
"description": ""
}
]
},
"SinkType": {
"description": "Where to sink the data",
"type": "string",
"oneOf": [
{
"const": "NONE",
"description": "Don't sink. This is the default"
},
{
"const": "JBDC",
"description": "dataset will be sinked to a JDBC Database. See JdbcSink"
},
{
"const": "BQ",
"description": "Dataset is sinked to BigQuery. See BigQuerySink"
},
{
"const": "ES",
"description": "Dataset is indexed into Elasticsearch. See EsSink below"
},
{
"const": "FS",
"description": "Sink to Filesystem"
},
{
"const": "KAFKA",
"description": "Sink to Kafka"
}
]
},
"Mode": {
"description": "FILE mode by default.\\nFILE and STREAM are the two accepted values.\\nFILE is currently the only supported mode.",
"type": "string",
"oneOf": [
{
"const": "FILE",
"description": ""
},
{
"const": "STREAM",
"description": ""
},
{
"const": "FILE_AND_STREAM",
"description": ""
}
]
},
"Type": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"primitiveType": {
"$ref": "#/definitions/PrimitiveType"
},
"pattern": {
"type": "string"
},
"zone": {
"type": "string",
"description": "Useful for timestamp / dates"
},
"sample": {
"type": "string"
},
"comment": {
"type": "string"
},
"indexMapping": {
"type": "string"
}
},
"required": [
"name",
"pattern",
"primitiveType"
]
},
"Partition": {
"description": "Partition columns, no partitioning by default",
"type": "object",
"properties": {
"sampling": {
"type": "number",
"description": "0.0 means no sampling, > 0 && < 1 means sample dataset, >=1 absolute number of partitions."
},
"attributes": {
"type": "array",
"items": {
"type": "string",
"description": "Attributes used to partition de dataset."
}
}
},
"required": []
},
"Position": {
"type": "object",
"properties": {
"first": {
"type": "number"
},
"last": {
"type": "number"
}
},
"required": [
"first",
"last"
]
},
"RowLevelSecurity": {
"description": "Row level security policy to apply too the output data.",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "This Row Level Security unique name"
},
"predicate": {
"type": "string",
"description": "The condition that goes to the WHERE clause and limit the visible rows."
},
"grants": {
"description": "user / groups / service accounts to which this security level is applied.\nex : user:[email protected],group:[email protected],serviceAccount:[email protected]",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"MergeOptions": {
"type": "object",
"properties": {
"key": {
"description": "list of attributes to join existing with incoming dataset. Use renamed columns here.",
"type": "array",
"items": {
"type": "string"
}
},
"delete": {
"type": "string",
"description": "Optional valid sql condition on the incoming dataset. Use renamed column here."
},
"timestamp": {
"type": "string",
"description": "Timestamp column used to identify last version, if not specified currently ingested row is considered the last"
},
"queryFilter": {
"type": "string"
}
},
"required": [
"key"
]
},
"Format": {
"description": "DSV by default. Supported file formats are :\\n- DSV : Delimiter-separated values file. Delimiter value is specified in the \"separator\" field.\\n- POSITION : FIXED format file where values are located at an exact position in each line.\\n- SIMPLE_JSON : For optimisation purpose, we differentiate JSON with top level values from JSON\\n with deep level fields. SIMPLE_JSON are JSON files with top level fields only.\\n- JSON : Deep JSON file. Use only when your json documents contain subdocuments, otherwise prefer to\\n use SIMPLE_JSON since it is much faster.\\n- XML : XML files",
"type": "string",
"oneOf": [
{
"const": "DSV",
"description": ""
},
{
"const": "POSITION",
"description": ""
},
{
"const": "JSON",
"description": ""
},
{
"const": "ARRAY_JSON",
"description": ""
},
{
"const": "SIMPLE_JSON",
"description": "Simple Json is made of a single level attributes of simple types (no array or map or sub objects)"
},
{
"const": "XML",
"description": ""
}
]
},
"MapString": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"Sink": {
"type": "object",
"properties": {
"type": {
"$ref": "#/definitions/SinkType",
"description": "Once ingested, files may be sinked to BigQuery, Elasticsearch or any JDBC compliant Database."
},
"name": {
"type": "string",
"description": "Once ingested, files may be sinked to BigQuery, Elasticsearch or any JDBC compliant Database."
},
"id": {
"type": "string",
"description": "ES: Attribute to use as id of the document. Generated by Elasticsearch if not specified."
},
"timestamp": {
"type": "string",
"description": "BQ: The timestamp column to use for table partitioning if any. No partitioning by default\\nES:Timestamp field format as expected by Elasticsearch (\"{beginTs|yyyy.MM.dd}\" for example)."
},
"location": {
"type": "string",
"description": "BQ: Database location (EU, US, ...)"
},
"clustering": {
"type": "string",
"description": "BQ: List of ordered columns to use for table clustering"
},
"days": {
"type": "number",
"description": "BQ: Number of days before this table is set as expired and deleted. Never by default."
},
"requirePartitionFilter": {
"type": "boolean",
"description": "BQ: Should be require a partition filter on every request ? No by default."
},
"connection": {
"type": "string",
"description": "JDBC: Connection String"
},
"partitions": {
"type": "number",
"description": "JDBC: Number of Spark partitions"
},
"batchSize": {
"type": "number",
"description": "JDBC: Batch size of each JDBC bulk insert"
}
},
"required": [
"type"
]
},
"Metadata": {
"type": "object",
"properties": {
"partition": {
"$ref": "#/definitions/Partition"
},
"mode": {
"$ref": "#/definitions/Mode"
},
"format": {
"$ref": "#/definitions/Format"
},
"encoding": {
"type": "string",
"description": "UTF-8 if not specified."
},
"multiline": {
"type": "boolean",
"description": "are json objects on a single line or multiple line ? Single by default. false means single. false also means faster"
},
"array": {
"type": "boolean",
"description": "Is the json stored as a single object array ? false by default. This means that by default we have on json document per line."
},
"withHeader": {
"type": "boolean",
"description": "does the dataset has a header ? true bu default"
},
"separator": {
"type": "string",
"description": "the values delimiter, ';' by default value may be a multichar string starting from Spark3"
},
"quote": {
"type": "string",
"description": "The String quote char, '\"' by default"
},
"escape": {
"type": "string",
"description": "escaping char '\\' by default"
},
"write": {
"$ref": "#/definitions/WriteMode",
"description": "Write mode, APPEND by default"
},
"sink": {
"$ref": "#/definitions/Sink"
},
"clustering": {
"description": "List of attributes to use for clustering",
"type": "array",
"items": {
"type": "string"
}
},
"ignore": {
"type": "string",
"description": "Pattern to ignore or UDF to apply to ignore some lines"
},
"xml": {
"$ref": "#/definitions/MapString",
"description": "com.databricks.spark.xml options to use (eq. rowTag)"
}
}
},
"Schema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Schema name, must be unique among all the schemas belonging to the same domain.\n * Will become the hive table name On Premise or BigQuery Table name on GCP."
},
"pattern": {
"description": "filename pattern to which this schema must be applied.\n * This instructs the framework to use this schema to parse any file with a filename that match this pattern.",
"type": "string"
},
"primaryKey": {
"description": "List of columns that make up the primary key",
"type": "array",
"items": {
"type": "string"
}
},
"attributes": {
"description": "Attributes parsing rules.",
"type": "array",
"items": {
"$ref": "#/definitions/Attribute"
}
},
"metadata": {
"$ref": "#/definitions/Metadata",
"description": "Dataset metadata"
},
"merge": {
"$ref": "#/definitions/MergeOptions"
},
"comment": {
"type": "string",
"description": "free text"
},
"presql": {
"type": "array",
"description": "Reserved for future use.",
"items": {
"type": "string"
}
},
"postsql": {
"type": "array",
"description": "Reserved for future use.",
"items": {
"type": "string"
}
},
"tags": {
"description": "Set of string to attach to this Schema",
"type": "array",
"items": {
"type": "string"
}
},
"rls": {
"description": " Experimental. Row level security to this to this schema.",
"type": "array",
"items": {
"$ref": "#/definitions/RowLevelSecurity"
}
},
"assertions": {
"$ref": "#/definitions/MapString",
"description": "Assertions to check after Load / Transform has succeeded"
}
}
},
"Attribute": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Attribute name as defined in the source dataset and as received in the file"
},
"type": {
"type": "string",
"description": "semantic type of the attribute"
},
"foreignKey": {
"type": "string",
"description": "If this attribute is a foreign key, reference to [domain.]table[.attribute]"
},
"array": {
"type": "boolean",
"description": "Is it an array ?"
},
"required": {
"type": "boolean",
"description": "Should this attribute always be present in the source"
},
"privacy": {
"type": "string",
"description": "Should this attribute be applied a privacy transformation at ingestion time"
},
"comment": {
"type": "string",
"description": "free text for attribute description"
},
"rename": {
"type": "string",
"description": "If present, the attribute is renamed with this name"
},
"metricType": {
"type": "string",
"description": "If present, what kind of stat should be computed for this field"
},
"attributes": {
"type": "array",
"description": "List of sub-attributes (valid for JSON and XML files only)",
"items": {
"$ref": "#/definitions/Attribute"
}
},
"position": {
"$ref": "#/definitions/Position"
},
"default": {
"type": "string",
"description": "Default value for this attribute when it is not present."
},
"tags": {
"type": "array",
"description": "Tags associated with this attribute",
"items": {
"type": "string"
}
},
"trim": {
"$ref": "#/definitions/Trim"
},
"script": {
"type": "string",
"description": "Scripted field : SQL request on renamed column"
}
},
"required": [
"name",
"type"
]
},
"AutoTaskDesc": {
"type": "object",
"properties": {
"sql": {
"type": "string",
"description": "Main SQL request to execute (do not forget to prefix table names with the database name to avoid conflicts)"
},
"engine": {
"$ref": "#/definitions/Engine",
"description": "When not SPARK, the entire SQL query is pushed down."
},
"domain": {
"type": "string",
"description": "Output domain in output Area (Will be the Database name in Hive or Dataset in BigQuery)"
},
"dataset": {
"type": "string",
"description": "Dataset Name in output Area (Will be the Table name in Hive & BigQuery)"
},
"write": {
"$ref": "#/definitions/WriteMode"
},
"area": {
"type": "string",
"description": "Target Area where domain / dataset will be stored."
},
"partition": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of columns used for partitioning the output."
},
"presql": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of SQL requests to executed before the main SQL request is run"
},
"postsql": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of SQL requests to executed after the main SQL request is run"
},
"sink": {
"$ref": "#/definitions/Sink"
},
"rls": {
"type": "array",
"items": {
"$ref": "#/definitions/RowLevelSecurity"
}
},
"assertions": {
"$ref": "#/definitions/MapString",
"description": "Assertions to check after Load / Transform has succeeded"
}
},
"required": [
"domain",
"dataset",
"write"
]
},
"Domain": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Domain name. Make sure you use a name that may be used as a folder name on the target storage.\n - When using HDFS or Cloud Storage, files once ingested are stored in a sub-directory named after the domain name.\n - When used with BigQuery, files are ingested and sorted in tables under a dataset named after the domain name."
},
"directory": {
"description": "Folder on the local filesystem where incoming files are stored.\n Typically, this folder will be scanned periodically to move the dataset to the cluster for ingestion.\n Files located in this folder are moved to the pending folder for ingestion by the \"import\" command.",
"type": "string"
},
"metadata": {
"$ref": "#/definitions/Metadata"
},
"schemaRefs": {
"type": "array",
"description": "List of files containing the schemas. Should start with an '_' and be located in the same folder.",
"items": {
"type": "string"
}
},
"schemas": {
"type": "array",
"description": "List of schemas for each dataset in this domain.\nA domain usually contains multiple schemas. Each schema defining how the contents of the input file should be parsed.\nSee Schema for more details.",
"items": {
"$ref": "#/definitions/Schema"
}
},
"comment": {
"description": "Domain Description (free text)",
"type": "string"
},
"extensions": {
"type": "array",
"items": {
"type": "string"
},
"description": "recognized filename extensions. json, csv, dsv, psv are recognized by default.\nOnly files with these extensions will be moved to the pending folder."
},
"ack": {
"description": "Ack extension used for each file. \".ack\" if not specified.\nFiles are moved to the pending folder only once a file with the same name as the source file and with this extension is present.\nTo move a file without requiring an ack file to be present, set explicitly this property to the empty string value \"\".",
"type": "string"
}
},
"anyOf": [
{
"required": [
"name",
"directory",
"schemas"
]
},
{
"required": [
"name",
"directory",
"schemaRefs"
]
}
]
},
"AutoJobDesc": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Job name. Must be set to the prefix of the filename. [JOBNAME].comet.yml "
},
"area": {
"type": "string",
"description": "Area where the data is located.\\nWhen using the BigQuery engine, the area corresponds to the dataset name we will be working on in this job.\\nWhen using the Spark engine, this is folder where the data should be store. Default value is \"business\""
},
"format": {
"type": "string",
"description": "output file format when using Spark engine. Ignored for BigQuery. Default value is \"parquet\""
},
"coalesce": {
"type": "boolean",
"description": "When outputting files, should we coalesce it to a single file. Useful when CSV is the output format."
},
"tasks": {
"type": "array",
"items": {
"$ref": "#/definitions/AutoTaskDesc",
"description": "List of transform tasks to execute"
}
},
"udf": {
"type": "string",
"description": "Register UDFs written in this JVM class when using Spark engine.\\nRegister UDFs stored at this location when using BigQuery engine"
},
"views": {
"$ref": "#/definitions/MapString",
"description": "Create temporary views using where the key is the view name and the map the SQL request corresponding to this view using the SQL engine supported syntax."
},
"engine": {
"$ref": "#/definitions/Engine"
}
},
"required": [
"name",
"tasks"
]
}
},
"type": "object",
"properties": {
"types": {
"type": "array",
"items": {
"$ref": "#/definitions/Type"
}
},
"env": {
"$ref": "#/definitions/MapString"
},
"transform": {
"$ref": "#/definitions/AutoJobDesc"
},
"load": {
"$ref": "#/definitions/Domain"
},
"assertions": {
"$ref": "#/definitions/MapString",
"description": "Assertions library defined as a map name(params) -> sql request that should return 0 record"
},
"views": {
"$ref": "#/definitions/MapString"
},
"schemas": {
"type": "array",
"description": "List of schemas for each dataset in this domain.\nA domain usually contains multiple schemas. Each schema defining how the contents of the input file should be parsed.\nSee Schema for more details.",
"items": {
"$ref": "#/definitions/Schema"
}
}
},
"oneOf": [
{
"required": [
"load"
]
},
{
"required": [
"views"
]
},
{
"required": [
"assertions"
]
},
{
"required": [
"env"
]
},
{
"required": [
"types"
]
},
{
"required": [
"transform"
]
},
{
"required": [
"schemas"
]
}
]
}