abhagraw commented on code in PR #13374:
URL: https://github.com/apache/druid/pull/13374#discussion_r1025757408


##########
integration-tests-ex/cases/src/test/resources/multi-stage-query/batch-index/wikipedia_index_msq.json:
##########
@@ -0,0 +1,4 @@
+{
+  "sqlTask" : "REPLACE INTO \"%%DATASOURCE%%\" OVERWRITE ALL\nWITH \"source\" 
as (SELECT * FROM TABLE(\n  EXTERN(\n    
'{\"type\":\"local\",\"files\":[\"/resources/data/batch_index/json/wikipedia_index_data1.json\",\"/resources/data/batch_index/json/wikipedia_index_data2.json\",\"/resources/data/batch_index/json/wikipedia_index_data3.json\"]}',\n
    '{\"type\":\"json\"}',\n    
'[{\"name\":\"timestamp\",\"type\":\"string\"},{\"name\":\"page\",\"type\":\"string\"},{\"name\":\"language\",\"type\":\"string\"},{\"name\":\"user\",\"type\":\"string\"},{\"name\":\"unpatrolled\",\"type\":\"string\"},{\"name\":\"newPage\",\"type\":\"string\"},{\"name\":\"robot\",\"type\":\"string\"},{\"name\":\"anonymous\",\"type\":\"string\"},{\"name\":\"namespace\",\"type\":\"string\"},{\"name\":\"continent\",\"type\":\"string\"},{\"name\":\"country\",\"type\":\"string\"},{\"name\":\"region\",\"type\":\"string\"},{\"name\":\"city\",\"type\":\"string\"},{\"name\":\"added\",\"type\":\"double\"},{\"name\":\"de
 leted\",\"type\":\"double\"},{\"name\":\"delta\",\"type\":\"double\"}]'\n  
)\n))\nSELECT\n  TIME_FLOOR(CASE WHEN CAST(\"timestamp\" AS BIGINT) > 0 THEN 
MILLIS_TO_TIMESTAMP(CAST(\"timestamp\" AS BIGINT)) ELSE 
TIME_PARSE(\"timestamp\") END, 'PT1S') AS __time,\n  \"page\",\n  
\"language\",\n  \"user\",\n  \"unpatrolled\",\n  \"newPage\",\n  \"robot\",\n  
\"anonymous\",\n  \"namespace\",\n  \"continent\",\n  \"country\",\n  
\"region\",\n  \"city\",\n  COUNT(*) AS \"count\",\n  SUM(\"added\") AS 
\"added\",\n  SUM(\"deleted\") AS \"deleted\",\n  SUM(\"delta\") AS 
\"delta\",\n  APPROX_COUNT_DISTINCT_DS_THETA(\"user\") AS \"thetaSketch\",\n  
DS_QUANTILES_SKETCH(\"delta\") AS \"quantilesDoublesSketch\",\n  
APPROX_COUNT_DISTINCT_DS_HLL(\"user\") AS \"HLLSketchBuild\"\nFROM 
\"source\"\nGROUP BY 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13\nPARTITIONED BY 
DAY",

Review Comment:
   json files does not support pretty multi-line string syntax.
   ref - https://stackoverflow.com/a/52557585
   
   Have changed structure, and not MSQ sql ingestion queries are placed in 
separate sql files which are more readable.



-- 
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]

Reply via email to