You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2018/08/08 18:09:53 UTC

[GitHub] jihoonson commented on a change in pull request #6119: Add docs for virtual columns and transform specs

jihoonson commented on a change in pull request #6119: Add docs for virtual columns and transform specs
URL: https://github.com/apache/incubator-druid/pull/6119#discussion_r208680643
 
 

 ##########
 File path: docs/content/querying/virtual-columns.md
 ##########
 @@ -0,0 +1,59 @@
+---
+layout: doc_page
+---
+
+# Virtual Columns
+
+Virtual columns are queryable column "views" created from a set of columns during a query. 
+
+A virtual column can potentially draw from multiple underlying columns, although a virtual column always presents itself as a single column.
+
+Virtual columns can be used as dimensions or as inputs to aggregators.
+
+Each Druid query can accept a list of virtual columns as a parameter. The following scan query is provided as an example:
+
+```
+{
+ "queryType": "scan",
+ "dataSource": "page_data",
+ "columns":[],
+ "virtualColumns": [
+    {
+      "type": "expression",
+      "name": "fooPage",
+      "expression": "concat('foo' + page)",
+      "outputType": "STRING"
+    },
+    {
+      "type": "expression",
+      "name": "tripleWordCount",
+      "expression": "wordCount * 3",
+      "outputType": "LONG"
+    }
+  ],
+ "intervals": [
+   "2013-01-01/2019-01-02"
+ ] 
+}
+```
+
+## Expression virtual column
+
+Druid currently has one type of virtual column, the expression virtual column.
 
 Review comment:
   We have one more virtual column type, `map` virtual column. This virtual column is implemented as an extension, so we need to add a separate page for `map` virtual column and add a link to http://druid.io/docs/latest/development/extensions.html.
   
   Probably this doesn't have to be a part of this PR.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org