Skip to content

Conversation

tobegit3hub
Copy link
Collaborator

The Spark distribution need to be changed like this.

diff --git a/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala b/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala
index 0c5496bf9d..68c92302f3 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala
@@ -3273,9 +3273,6 @@ class Dataset[T] private[sql](
   @deprecated("Use createOrReplaceTempView(viewName) instead.", "2.0.0")
   def registerTempTable(tableName: String): Unit = {
     createOrReplaceTempView(tableName)
-
-    // Add by 4paradigm
-    sparkSession.openmldbSession.registerTable(tableName, this.asInstanceOf[DataFrame])
   }

   /**
@@ -3306,6 +3303,10 @@ class Dataset[T] private[sql](
    * @since 2.0.0
    */
   def createOrReplaceTempView(viewName: String): Unit = withPlan {
+    // Add by 4paradigm
+    //sparkSession.openmldbSession.registerTable(viewName, this.asInstanceOf[DataFrame])
+    sparkSession.openmldbSession.registerTableInOpenmldbSession(viewName, this.asInstanceOf[DataFrame])
+
     createTempViewCommand(viewName, replace = true, global = false)
   }

@tobegit3hub tobegit3hub added bug Something isn't working batch-engine openmldb batch(offline) engine labels Feb 15, 2023
@tobegit3hub tobegit3hub self-assigned this Feb 15, 2023
@codecov
Copy link

codecov bot commented Feb 15, 2023

Codecov Report

Base: 75.85% // Head: 37.14% // Decreases project coverage by -38.71% ⚠️

Coverage data is based on head (6c3e1f8) compared to base (6308015).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@              Coverage Diff              @@
##               main    #3057       +/-   ##
=============================================
- Coverage     75.85%   37.14%   -38.71%     
  Complexity      393      393               
=============================================
  Files           658      159      -499     
  Lines        124040     9435   -114605     
  Branches       1121     1076       -45     
=============================================
- Hits          94093     3505    -90588     
+ Misses        29711     5694    -24017     
  Partials        236      236               
Impacted Files Coverage Δ
...4paradigm/openmldb/batch/api/OpenmldbSession.scala 60.57% <100.00%> (+0.77%) ⬆️
hybridse/src/codegen/context.cc
hybridse/src/node/batch_plan_node.cc
src/storage/table.h
hybridse/examples/toydb/src/storage/table_impl.h
hybridse/src/planv2/ast_node_converter.cc
src/storage/schema.h
hybridse/include/node/node_base.h
hybridse/src/vm/window_test.cc
...ybridse/examples/toydb/src/tablet/tablet_catalog.h
... and 490 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link
Contributor

SDK Test Report

  87 files    87 suites   1m 53s ⏱️
181 tests 172 ✔️ 9 💤 0
227 runs  218 ✔️ 9 💤 0

Results for commit 6c3e1f8.

@github-actions
Copy link
Contributor

Linux Test Report

590 tests   583 ✔️  26m 46s ⏱️
  58 suites      7 💤
  52 files        0

Results for commit 6c3e1f8.

@tobegit3hub tobegit3hub merged commit f178654 into 4paradigm:main Feb 27, 2023
@lqy222 lqy222 mentioned this pull request May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
batch-engine openmldb batch(offline) engine bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fail to get registered table when enabling sparksql for offline
3 participants