Skip to content

Commit

Permalink
[SPARK-40799][BUILD][CONNECT][FOLLOW-UP] Enforce scalafmt for Spark C…
Browse files Browse the repository at this point in the history
…onnect module

### What changes were proposed in this pull request?

This PR run `scalafmt` in master branch to format scala files in Connect module which will fix Scala lint.

### Why are the changes needed?

Fix Scala lint.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

UT

Closes apache#38290 from amaliujia/fix_lint_scala.

Authored-by: Rui Wang <rui.wang@databricks.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
  • Loading branch information
amaliujia authored and SandishKumarHN committed Dec 12, 2022
1 parent 00cbd23 commit 0ab837c
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@ package object dsl {
.build()

def struct(
attrs: proto.Expression.QualifiedAttribute*): proto.Expression.QualifiedAttribute = {
attrs: proto.Expression.QualifiedAttribute*): proto.Expression.QualifiedAttribute = {
val structExpr = proto.DataType.Struct.newBuilder()
for (attr <- attrs) {
val structField = proto.DataType.StructField.newBuilder()
structField.setName(attr.getName)
structField.setType(attr.getType)
structExpr.addFields(structField)
}
proto.Expression.QualifiedAttribute.newBuilder()
proto.Expression.QualifiedAttribute
.newBuilder()
.setName(s)
.setType(proto.DataType.newBuilder().setStruct(structExpr))
.build()
Expand All @@ -65,8 +66,9 @@ package object dsl {
proto.DataType.newBuilder().setI32(proto.DataType.I32.newBuilder()).build())

private def protoQualifiedAttrWithType(
dataType: proto.DataType): proto.Expression.QualifiedAttribute =
proto.Expression.QualifiedAttribute.newBuilder()
dataType: proto.DataType): proto.Expression.QualifiedAttribute =
proto.Expression.QualifiedAttribute
.newBuilder()
.setName(s)
.setType(dataType)
.build()
Expand Down

0 comments on commit 0ab837c

Please sign in to comment.