File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
fuzz-testing/src/main/scala/org/apache/comet/fuzz Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,12 @@ object ComparisonTool {
117117 // Compare the results
118118 if (QueryComparison .assertSameRows(sparkRows, cometRows, output)) {
119119 output.write(s " Subfolder $subfolderName: ${sparkRows.length} rows matched \n\n " )
120+ } else {
121+ // Output schema if dataframes are not equal
122+ QueryComparison .showSchema(
123+ output,
124+ sparkDf.schema.treeString,
125+ cometDf.schema.treeString)
120126 }
121127 } catch {
122128 case e : Exception =>
Original file line number Diff line number Diff line change @@ -156,14 +156,10 @@ object QueryComparison {
156156 val r = cometRows(i)
157157
158158 // Check the schema is equal for first row only
159- if (i == 0 ) {
160- showSchema( output, l. schema.treeString, r.schema.treeString )
159+ if (i == 0 && l.schema != r.schema ) {
160+ output.write( " [ERROR] Spark produced different schema than Comet. \n " )
161161
162- if (l.schema != r.schema) {
163- output.write(" [ERROR] Spark produced different schema than Comet.\n " )
164-
165- return false
166- }
162+ return false
167163 }
168164
169165 assert(l.length == r.length)
You can’t perform that action at this time.
0 commit comments