cgivre commented on a change in pull request #1539: DRILL-6847: Add Query
Metadata to RESTful Interface
URL: https://github.com/apache/drill/pull/1539#discussion_r233405972
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/WebUserConnection.java
##########
@@ -106,7 +110,10 @@ public void sendData(RpcOutcomeListener<Ack> listener,
QueryWritableBatch result
// TODO: Clean: DRILL-2933: That load(...) no longer throws
// SchemaChangeException, so check/clean catch clause below.
for (int i = 0; i < loader.getSchema().getFieldCount(); ++i) {
- columns.add(loader.getSchema().getColumn(i).getName());
+
+ MaterializedField col = loader.getSchema().getColumn(i);
+ columns.add(col.getName());
+ metadata.add(col.getType().getMinorType().name());
Review comment:
Hi @arina-ielchiieva ,
The use case I had in mind was integrating Drill with SQLPad and Apache
Superset. In these instances basically, the UI needed to know if a field was
numeric, temporal of any sort, or text so that it could render visualizations
properly.
I'm sure there are other use cases out there, but I know that for me at
least, this was a major blocker in getting Drill to work with the various BI
tools. The JDBC interface provided this information, but the RESTful interface
did not, so I had to resort to hackery.
So to answer your question, it might be useful for other use cases to
provide precision and scale, but for the one I had in mind, that would not be
helpful.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services