hudi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-hudi] satishkotha commented on a change in pull request #1341: [HUDI-626] Add exportToTable option to CLI
Date Thu, 20 Feb 2020 18:57:09 GMT
satishkotha commented on a change in pull request #1341: [HUDI-626] Add exportToTable option
to CLI
URL: https://github.com/apache/incubator-hudi/pull/1341#discussion_r382193841
 
 

 ##########
 File path: hudi-cli/src/main/java/org/apache/hudi/cli/HoodiePrintHelper.java
 ##########
 @@ -57,11 +60,38 @@ public static String print(String[] header, String[][] rows) {
    */
   public static String print(TableHeader rowHeader, Map<String, Function<Object, String>>
fieldNameToConverterMap,
       String sortByField, boolean isDescending, Integer limit, boolean headerOnly, List<Comparable[]>
rows) {
+    return print(rowHeader, fieldNameToConverterMap, sortByField, isDescending, limit, headerOnly,
rows, "");
+  }
+
+  /**
+   * Serialize Table to printable string and also export a temporary view to easily write
sql queries.
+   *
+   * Ideally, exporting view needs to be outside PrintHelper, but all commands use this.
So this is easy
+   * way to add support for all commands
+   *
+   * @param rowHeader Row Header
+   * @param fieldNameToConverterMap Field Specific Converters
+   * @param sortByField Sorting field
+   * @param isDescending Order
+   * @param limit Limit
+   * @param headerOnly Headers only
+   * @param rows List of rows
+   * @param tempTableName table name to export
+   * @return Serialized form for printing
+   */
+  public static String print(TableHeader rowHeader, Map<String, Function<Object, String>>
fieldNameToConverterMap,
+      String sortByField, boolean isDescending, Integer limit, boolean headerOnly, List<Comparable[]>
rows,
+      String tempTableName) {
 
     if (headerOnly) {
       return HoodiePrintHelper.print(rowHeader);
     }
 
+    if (!Strings.isNullOrEmpty(tempTableName)) {
 
 Review comment:
   Done

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message