File tree Expand file tree Collapse file tree 2 files changed +48
-3
lines changed
main/scala/org/apache/spark/sql/execution/debug
test/scala/org/apache/spark/sql/execution/debug Expand file tree Collapse file tree 2 files changed +48
-3
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,11 @@ package object debug {
134
134
}
135
135
}
136
136
137
+ /**
138
+ * :: DeveloperApi ::
139
+ * Helper functions for checking that runtime types match a given schema.
140
+ */
141
+ @ DeveloperApi
137
142
object TypeCheck {
138
143
def typeCheck (data : Any , schema : DataType ): Unit = (data, schema) match {
139
144
case (null , _) =>
@@ -159,13 +164,20 @@ package object debug {
159
164
}
160
165
}
161
166
162
- case class TypeCheck (child : SparkPlan ) extends SparkPlan {
167
+ /**
168
+ * :: DeveloperApi ::
169
+ * Augments SchemaRDDs with debug methods.
170
+ */
171
+ @ DeveloperApi
172
+ private [sql] case class TypeCheck (child : SparkPlan ) extends SparkPlan {
163
173
import TypeCheck ._
164
- // def otherCopyArgs = null :: Nil
165
174
166
175
override def nodeName = " "
167
176
168
- override def makeCopy (args : Array [Object ]): this .type = TypeCheck (args(0 ).asInstanceOf [SparkPlan ]).asInstanceOf [this .type ]
177
+ /* Only required when defining this class in a REPL.
178
+ override def makeCopy(args: Array[Object]): this.type =
179
+ TypeCheck(args(0).asInstanceOf[SparkPlan]).asInstanceOf[this.type]
180
+ */
169
181
170
182
def output = child.output
171
183
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements. See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License. You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ package org .apache .spark .sql .execution .debug
19
+
20
+ import org .scalatest .FunSuite
21
+
22
+ import org .apache .spark .sql .TestData ._
23
+ import org .apache .spark .sql .test .TestSQLContext ._
24
+
25
+ class DebuggingSuite extends FunSuite {
26
+ test(" SchemaRDD.debug()" ) {
27
+ testData.debug()
28
+ }
29
+
30
+ test(" SchemaRDD.typeCheck()" ) {
31
+ testData.typeCheck()
32
+ }
33
+ }
You can’t perform that action at this time.
0 commit comments