kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [kudu] 02/02: Add toString implementation to org.apache.kudu.spark.kudu.KuduRelation
Date Mon, 18 Mar 2019 18:04:40 GMT
This is an automated email from the ASF dual-hosted git repository.

adar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit d140511fb10242993fe8d226f49c902393831865
Author: Florentino Sainz <tinosainz@gmail.com>
AuthorDate: Sun Mar 17 21:40:08 2019 +0100

    Add toString implementation to org.apache.kudu.spark.kudu.KuduRelation
    This toString is shown in Spark UI SQL view, right now what users see
    in the Spark UI is just the object default toString
    ("Scan org.apache.kudu.spark.kudu.KuduRelation@8ad78a")
    which doesn't provide good information.
    With this change, Spark UI will show the right name and also the table
    which is being read (so users know what we are actually Scanning).
    Spark UI SQL will now show "Scan Kudu my_table" (similar to
    other sources, like Parquet/Hive, which shows "Scan Parquet my_table" )
    instead, allowing much easier profiling on complex queries/DFs.
    So users can see that its a KUDU source and the name of the table.
    Change-Id: I58e11c36a0c7467baf43f99b9db41e2b4643bec8
    Reviewed-on: http://gerrit.cloudera.org:8080/12773
    Tested-by: Kudu Jenkins
    Reviewed-by: Adar Dembo <adar@cloudera.com>
    Reviewed-by: Grant Henke <granthenke@apache.org>
 .../src/main/scala/org/apache/kudu/spark/kudu/DefaultSource.scala | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/java/kudu-spark/src/main/scala/org/apache/kudu/spark/kudu/DefaultSource.scala
index 47b5ddd..139184b 100644
--- a/java/kudu-spark/src/main/scala/org/apache/kudu/spark/kudu/DefaultSource.scala
+++ b/java/kudu-spark/src/main/scala/org/apache/kudu/spark/kudu/DefaultSource.scala
@@ -424,6 +424,14 @@ class KuduRelation(
     context.writeRows(data, tableName, operationType, writeOptions)
+  /**
+    * Returns the string representation of this KuduRelation
+    * @return Kudu + tableName of the relation
+    */
+  override def toString(): String = {
+    "Kudu " + this.tableName
+  }
 private[spark] object KuduRelation {

View raw message