[GitHub] spark pull request #20127: [SPARK-22932] [SQL] Refactor AnalysisContext

2018-01-01 Thread cloud-fan
Github user cloud-fan commented on a diff in the pull request:

https://github.com/apache/spark/pull/20127#discussion_r159174832
  
--- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ---
@@ -95,6 +98,17 @@ class Analyzer(
 this(catalog, conf, conf.optimizerMaxIterations)
   }
 
+  override def execute(plan: LogicalPlan): LogicalPlan = {
+AnalysisContext.reset()
+try {
+  executeSameContext(plan)
+} finally {
+  AnalysisContext.reset()
+}
+  }
+
+  private def executeSameContext(plan: LogicalPlan): LogicalPlan = 
super.execute(plan)
--- End diff --

+1


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #20127: [SPARK-22932] [SQL] Refactor AnalysisContext

2018-01-01 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/spark/pull/20127


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #20127: [SPARK-22932] [SQL] Refactor AnalysisContext

2018-01-01 Thread gatorsmile
Github user gatorsmile commented on a diff in the pull request:

https://github.com/apache/spark/pull/20127#discussion_r159168110
  
--- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ---
@@ -70,6 +71,8 @@ object AnalysisContext {
   }
 
   def get: AnalysisContext = value.get()
+  def reset(): Unit = value.remove()
--- End diff --

Will be resolved by the future PR.


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #20127: [SPARK-22932] [SQL] Refactor AnalysisContext

2018-01-01 Thread viirya
Github user viirya commented on a diff in the pull request:

https://github.com/apache/spark/pull/20127#discussion_r159150900
  
--- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ---
@@ -95,6 +98,17 @@ class Analyzer(
 this(catalog, conf, conf.optimizerMaxIterations)
   }
 
+  override def execute(plan: LogicalPlan): LogicalPlan = {
+AnalysisContext.reset()
+try {
+  executeSameContext(plan)
+} finally {
+  AnalysisContext.reset()
+}
+  }
+
+  private def executeSameContext(plan: LogicalPlan): LogicalPlan = 
super.execute(plan)
--- End diff --

`executeWithSameContext`?


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #20127: [SPARK-22932] [SQL] Refactor AnalysisContext

2018-01-01 Thread viirya
Github user viirya commented on a diff in the pull request:

https://github.com/apache/spark/pull/20127#discussion_r159150948
  
--- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ---
@@ -70,6 +71,8 @@ object AnalysisContext {
   }
 
   def get: AnalysisContext = value.get()
+  def reset(): Unit = value.remove()
--- End diff --

`private`


---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #20127: [SPARK-22932] [SQL] Refactor AnalysisContext

2017-12-31 Thread gatorsmile
GitHub user gatorsmile opened a pull request:

https://github.com/apache/spark/pull/20127

[SPARK-22932] [SQL] Refactor AnalysisContext

## What changes were proposed in this pull request?
Add a `reset` function to ensure the state in `AnalysisContext ` is 
per-query. 

## How was this patch tested?
The existing test cases

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/gatorsmile/spark refactorAnalysisContext

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/spark/pull/20127.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #20127


commit f158a951b779e56e06d2c73234bac5c79055b2f5
Author: gatorsmile 
Date:   2017-12-31T13:21:13Z

refactor




---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org