paul-rogers opened a new pull request, #13958:
URL: https://github.com/apache/druid/pull/13958

   Druid recently added support for nested JSON types. The JSON-style of 
`extern()` can label input columns as a JSON object or array using the Druid 
`complex<json>` type. This PR adds an equivalent of the type to SQL using the 
`VARIANT` keyword. Example:
   
   ```sql
   INSERT INTO dst SELECT *
   FROM TABLE(http(uris => ARRAY['http://foo.com/bar.json'],
                   format => 'csv'))
        (x VARCHAR, y VARCHAR, z VARIANT)
   PARTITIONED BY ALL TIME
   ```
   
   The semantics are that the `z` column above is _some_ complex JSON type, but 
we don't care which: Druid's indexer will figure it out. Since we don't know 
the exact type (other than that it isn't simple), we let Druid do the work by 
declaring that the input column type varies: it is of type `VARIANT`. At run 
time, Druid will pick the actual type, which may be `complex<json>` or may be 
something else.
   
   #### Release note
   
   See the comments above and the modified `reference.md` file.
   
   Druid has added a new keyword, `VARIANT` in this release. In the unlikely 
event that your tables or columns use that name, you must now quote the name in 
SQL statements.
   
   <hr>
   
   This PR has:
   
   - [X] been self-reviewed.
   - [X] added documentation for new or modified features or behaviors.
   - [X] a release note entry in the PR description.
   - [X] added Javadocs for most classes and all non-trivial methods. Linked 
related entities via Javadoc links.
   - [X] added unit tests or modified existing tests to cover new code paths, 
ensuring the threshold for [code 
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
 is met.
   - [ ] added integration tests.
   - [ ] been tested in a test Druid cluster.
   


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