aadilkhalifa commented on code in PR #12537:
URL: https://github.com/apache/pinot/pull/12537#discussion_r1676834608
##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java:
##########
@@ -1558,6 +1571,60 @@ private void computeResultsForLiteral(Literal literal,
List<String> columnNames,
}
}
+ private BrokerResponseNative processShowTablesQuery(long
compilationStartTimeNs,
+ RequestContext requestContext) {
+ BrokerResponseNative brokerResponse = new BrokerResponseNative();
+ String[] columnNames = {"Tables"};
+ DataSchema.ColumnDataType[] columnTypes =
{DataSchema.ColumnDataType.STRING};
+
+
+ DataSchema dataSchema = new DataSchema(columnNames, columnTypes);
+ List<Object[]> rows = new ArrayList<>();
+
_tableCache.getTableConfigs().stream().map(TableConfig::getTableName).sorted().forEach(a
-> {
+ a = a.replace("_OFFLINE", "").replace("_REALTIME", "");
+ rows.add(new String[] {a});
+ });
+ ResultTable resultTable = new ResultTable(dataSchema, rows);
+ brokerResponse.setResultTable(resultTable);
+
+ long totalTimeMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() -
compilationStartTimeNs);
+ brokerResponse.setTimeUsedMs(totalTimeMs);
+ requestContext.setQueryProcessingTime(totalTimeMs);
+ augmentStatistics(requestContext, brokerResponse);
+ return brokerResponse;
+ }
+
+ private BrokerResponseNative processDescribeTableQuery(String tableName,
long compilationStartTimeNs,
Review Comment:
I've added check for database tables access. Any other access control
required?
--
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]