Skip to content

Commit

Permalink
Debug descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
pondzix committed May 6, 2024
1 parent 9022980 commit a96e8a2
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,16 @@ object BigQuerySchemaUtils {

def showDescriptor(descriptor: Descriptors.Descriptor): String =
descriptor.getFields.asScala
.map(_.getName)
.map { field =>
val name = field.getName
val fieldType = field.getType
if (field.getType == Descriptors.FieldDescriptor.Type.MESSAGE) {
val nested = showDescriptor(field.getMessageType)
s"$name : $fieldType - nested {$nested}"
} else {
s"$name : $fieldType"
}
}
.mkString(", ")

}

0 comments on commit a96e8a2

Please sign in to comment.