vtlim commented on code in PR #15897:
URL: https://github.com/apache/druid/pull/15897#discussion_r1505079620
##########
docs/querying/datasource.md:
##########
@@ -211,6 +219,50 @@ Inline datasources are not available in Druid SQL.
Refer to the [Query execution](query-execution.md#inline) page for more
details on how queries are executed when you
use inline datasources.
+### Dynamic table append `TABLE(APPEND(...))`
Review Comment:
* Since this has the same native query syntax as `union` should this content
go within the existing `union` section?
* Suggest removing the SQL syntax from the header title, so just have `####
Dynamic table append`
##########
docs/querying/datasource.md:
##########
@@ -211,6 +219,50 @@ Inline datasources are not available in Druid SQL.
Refer to the [Query execution](query-execution.md#inline) page for more
details on how queries are executed when you
use inline datasources.
+### Dynamic table append `TABLE(APPEND(...))`
+
+This is essentially an SQL level syntactic sugar which matches columns by name
from multiple tables.
Review Comment:
```suggestion
Perform dynamic table appends in SQL using `TABLE(APPEND(...))`. This
simplifies SQL syntax to match columns by name from multiple tables. The native
query syntax remains the same as for native union datasources.
```
##########
docs/querying/datasource.md:
##########
@@ -177,7 +177,15 @@ use union datasources.
### `inline`
<Tabs>
-<TabItem value="7" label="Native">
+<TabItem value="sql" label="SQL">
Review Comment:
Thanks for adding this missing example
##########
docs/querying/datasource.md:
##########
@@ -211,6 +219,50 @@ Inline datasources are not available in Druid SQL.
Refer to the [Query execution](query-execution.md#inline) page for more
details on how queries are executed when you
use inline datasources.
+### Dynamic table append `TABLE(APPEND(...))`
+
+This is essentially an SQL level syntactic sugar which matches columns by name
from multiple tables.
+Suppose you have 3 tables:
+* `table1` has `column1`
+* `table2` has `column2`
+* `table3` has `column1`, `column2`, `column3`
+
+It is possible to create an union view of the above tables is possible by
using UNION ALL:
Review Comment:
```suggestion
You can create a union view of all the tables by using UNION ALL:
```
##########
docs/querying/datasource.md:
##########
@@ -211,6 +219,50 @@ Inline datasources are not available in Druid SQL.
Refer to the [Query execution](query-execution.md#inline) page for more
details on how queries are executed when you
use inline datasources.
+### Dynamic table append `TABLE(APPEND(...))`
+
+This is essentially an SQL level syntactic sugar which matches columns by name
from multiple tables.
+Suppose you have 3 tables:
+* `table1` has `column1`
+* `table2` has `column2`
+* `table3` has `column1`, `column2`, `column3`
+
+It is possible to create an union view of the above tables is possible by
using UNION ALL:
+```sql
+SELECT column1,NULL AS column2,NULL AS column3 FROM table1
+UNION ALL
+SELECT NULL AS column1,column2,NULL AS column3 FROM table2
+UNION ALL
+SELECT column1,column2,column3 FROM table3
+```
+
+However depending on the size of the table's schema it might be quite
complicated to do that; `TABLE(APPEND('table1','table2','table3'))` represents
the same in a more compact form.
+
+<Tabs>
Review Comment:
All the sections that have these tabs do so at the beginning of the section,
so consider moving this to the top for consistency
##########
docs/querying/datasource.md:
##########
@@ -211,6 +219,50 @@ Inline datasources are not available in Druid SQL.
Refer to the [Query execution](query-execution.md#inline) page for more
details on how queries are executed when you
use inline datasources.
+### Dynamic table append `TABLE(APPEND(...))`
Review Comment:
Consider also including a line / link to this content from the [SQL syntax
doc](https://druid.apache.org/docs/latest/querying/sql#union-all) in
https://github.com/apache/druid/blob/master/docs/querying/sql.md?plain=1#L322
##########
docs/querying/datasource.md:
##########
@@ -211,6 +219,50 @@ Inline datasources are not available in Druid SQL.
Refer to the [Query execution](query-execution.md#inline) page for more
details on how queries are executed when you
use inline datasources.
+### Dynamic table append `TABLE(APPEND(...))`
+
+This is essentially an SQL level syntactic sugar which matches columns by name
from multiple tables.
+Suppose you have 3 tables:
Review Comment:
```suggestion
Suppose you have three tables:
```
--
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]