Skip to content

Commit aa02d90

Browse files
committed
Merge pull request #5 from scwf/hbase
make package logical and execution
2 parents 1302fdb + 1d10ddd commit aa02d90

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

sql/hbase/src/main/scala/org/apache/spark/sql/hbase/HBaseSQLParser.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import org.apache.spark.sql.catalyst.expressions._
2020
import org.apache.spark.sql.catalyst.plans.logical._
2121
import org.apache.spark.sql.catalyst.{SqlLexical, SqlParser}
2222
import org.apache.spark.sql.catalyst.SparkSQLParser
23+
import org.apache.spark.sql.hbase.logical.{DropTablePlan, CreateHBaseTablePlan}
2324

2425
class HBaseSQLParser extends SqlParser {
2526
protected val BULK = Keyword("BULK")

sql/hbase/src/main/scala/org/apache/spark/sql/hbase/HBaseStrategies.scala

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,12 @@
1717

1818
package org.apache.spark.sql.hbase
1919

20-
import org.apache.hadoop.conf.Configuration
21-
import org.apache.hadoop.hbase.client.HTable
22-
import org.apache.hadoop.hbase.filter.{Filter => HFilter}
2320
import org.apache.spark.sql.catalyst.expressions._
2421
import org.apache.spark.sql.catalyst.planning.{PhysicalOperation, QueryPlanner}
25-
import org.apache.spark.sql.catalyst.plans.logical
26-
import org.apache.spark.sql.catalyst.plans.logical.{Filter, Join, LogicalPlan}
22+
import org.apache.spark.sql.catalyst.plans.logical.{InsertIntoTable, LogicalPlan}
2723
import org.apache.spark.sql.execution._
28-
import org.apache.spark.sql.{SQLContext, SchemaRDD}
24+
import org.apache.spark.sql.SQLContext
25+
import org.apache.spark.sql.hbase.execution._
2926

3027
/**
3128
* HBaseStrategies
@@ -91,16 +88,16 @@ private[hbase] trait HBaseStrategies extends QueryPlanner[SparkPlan] {
9188

9289
object HBaseOperations extends Strategy {
9390
def apply(plan: LogicalPlan): Seq[SparkPlan] = plan match {
94-
case CreateHBaseTablePlan(
91+
case logical.CreateHBaseTablePlan(
9592
tableName, nameSpace, hbaseTableName,
9693
colsSeq, keyCols, nonKeyCols) =>
9794
Seq(CreateHBaseTableCommand(
9895
tableName, nameSpace, hbaseTableName,
9996
colsSeq, keyCols, nonKeyCols)
10097
(hbaseSQLContext))
101-
case logical.InsertIntoTable(table: HBaseRelation, partition, child, _) =>
98+
case InsertIntoTable(table: HBaseRelation, partition, child, _) =>
10299
new InsertIntoHBaseTable(table, planLater(child))(hbaseSQLContext) :: Nil
103-
case DropTablePlan(tableName) => Seq(DropHbaseTableCommand(tableName)(hbaseSQLContext))
100+
case logical.DropTablePlan(tableName) => Seq(DropHbaseTableCommand(tableName)(hbaseSQLContext))
104101
case _ => Nil
105102
}
106103
}

sql/hbase/src/main/scala/org/apache/spark/sql/hbase/HBaseCommands.scala renamed to sql/hbase/src/main/scala/org/apache/spark/sql/hbase/execution/HBaseCommands.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.spark.sql.hbase
17+
package org.apache.spark.sql.hbase.execution
1818

1919
import org.apache.spark.sql._
2020
import org.apache.spark.sql.catalyst.expressions.Attribute
2121
import org.apache.spark.sql.execution.{Command, LeafNode}
22+
import org.apache.spark.sql.hbase.{NonKeyColumn, KeyColumn, HBaseSQLContext}
2223

2324
case class CreateHBaseTableCommand(tableName: String,
2425
nameSpace: String,

sql/hbase/src/main/scala/org/apache/spark/sql/hbase/HBaseOperators.scala renamed to sql/hbase/src/main/scala/org/apache/spark/sql/hbase/execution/HBaseOperators.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
* limitations under the License.
1616
*/
1717

18-
package org.apache.spark.sql.hbase
18+
package org.apache.spark.sql.hbase.execution
1919

2020
import org.apache.spark.annotation.DeveloperApi
2121
import org.apache.spark.rdd.RDD
2222
import org.apache.spark.sql.catalyst.expressions._
2323
import org.apache.spark.sql.execution.{LeafNode, UnaryNode, SparkPlan}
24+
import org.apache.spark.sql.hbase.{HBaseSQLReaderRDD, HBaseSQLContext, HBaseRelation}
2425

2526
/**
2627
* :: DeveloperApi ::

sql/hbase/src/main/scala/org/apache/spark/sql/hbase/HBaseLogicalPlan.scala renamed to sql/hbase/src/main/scala/org/apache/spark/sql/hbase/logical/HBaseLogicalPlans.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.spark.sql.hbase
17+
package org.apache.spark.sql.hbase.logical
1818

1919
import org.apache.spark.sql.catalyst.plans.logical.Command
2020

0 commit comments

Comments
 (0)