Skip to content

Commit

Permalink
fixing typos
Browse files Browse the repository at this point in the history
  • Loading branch information
SandishKumarHN committed Oct 24, 2022
1 parent e6f3cab commit 70a5983
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private[sql] class ProtobufDeserializer(
}
} catch {
case ise: AnalysisException =>
throw QueryCompilationErrors.cannotConvertProtobufTypeToSqlTypeError(
throw QueryCompilationErrors.cannotConvertProtobufTypeToCatalystTypeError(
rootDescriptor.getName,
rootCatalystType.sql,
ise)
Expand Down Expand Up @@ -194,7 +194,7 @@ private[sql] class ProtobufDeserializer(
(updater, ordinal, value) =>
val byte_array = value match {
case s: ByteString => s.toByteArray
case _ => throw QueryCompilationErrors.invalidBytStringFormatError()
case _ => throw QueryCompilationErrors.invalidByteStringFormatError()
}
updater.set(ordinal, byte_array)

Expand Down Expand Up @@ -240,7 +240,7 @@ private[sql] class ProtobufDeserializer(
(updater, ordinal, value) => updater.set(ordinal, UTF8String.fromString(value.toString))

case _ =>
throw QueryCompilationErrors.cannotConvertProtobufTypeToDataTypeError(
throw QueryCompilationErrors.cannotConvertProtobufTypeToSqlTypeError(
toFieldStr(protoPath),
toFieldStr(catalystPath),
s"${protoType} ${protoType.toProto.getLabel} ${protoType.getJavaType}" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private[sql] class ProtobufSerializer(
(getter, ordinal) =>
val data = getter.getUTF8String(ordinal).toString
if (!enumSymbols.contains(data)) {
throw QueryCompilationErrors.cannotConvertDataTypeToProtobufEnumTypeError(
throw QueryCompilationErrors.cannotConvertCatalystTypeToProtobufEnumTypeError(
toFieldStr(catalystPath), toFieldStr(protoPath), data,
enumSymbols.mkString("\"", "\", \"", "\""))
}
Expand Down Expand Up @@ -213,7 +213,7 @@ private[sql] class ProtobufSerializer(
duration.build()

case _ =>
throw QueryCompilationErrors.cannotConvertDataTypeToProtobufTypeError(
throw QueryCompilationErrors.cannotConvertCatalystTypeToProtobufTypeError(
toFieldStr(catalystPath),
toFieldStr(protoPath),
catalystType.sql,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private[sql] object ProtobufUtils extends Logging {
def validateNoExtraRequiredProtoFields(): Unit = {
val extraFields = protoFieldArray.toSet -- matchedFields.map(_.fieldDescriptor)
extraFields.filterNot(isNullable).foreach { extraField =>
throw QueryCompilationErrors.cannotFindProtobufFieldInInCatalystError(
throw QueryCompilationErrors.cannotFindProtobufFieldInCatalystError(
toFieldStr(protoPath :+ extraField.getName()))
}
}
Expand Down Expand Up @@ -213,7 +213,7 @@ private[sql] object ProtobufUtils extends Logging {
descriptorProto,
fileDescriptorList.toArray)
if (fileDescriptor.getMessageTypes().isEmpty()) {
throw QueryCompilationErrors.noMessageTypeReturnError(fileDescriptor.getName())
throw QueryCompilationErrors.noProtobufMessageTypeReturnError(fileDescriptor.getName())
}
fileDescriptor
} catch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3212,7 +3212,7 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase {
)
}

def cannotConvertProtobufTypeToDataTypeError(
def cannotConvertProtobufTypeToSqlTypeError(
protobufColumn: String,
sqlColumn: String,
protobufType: String,
Expand All @@ -3226,7 +3226,7 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase {
"sqlType" -> sqlType))
}

def cannotConvertDataTypeToProtobufTypeError(
def cannotConvertCatalystTypeToProtobufTypeError(
sqlColumn: String,
protobufColumn: String,
sqlType: String,
Expand All @@ -3240,7 +3240,7 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase {
"protobufType" -> protobufType))
}

def cannotConvertDataTypeToProtobufEnumTypeError(
def cannotConvertCatalystTypeToProtobufEnumTypeError(
sqlColumn: String,
protobufColumn: String,
data: String,
Expand All @@ -3260,7 +3260,7 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase {
messageParameters = Map("protobufType" -> protobufType))
}

def cannotConvertProtobufTypeToSqlTypeError(
def cannotConvertProtobufTypeToCatalystTypeError(
protobufType: String,
sqlType: String,
e1: Throwable): Throwable = {
Expand Down Expand Up @@ -3300,7 +3300,7 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase {
messageParameters = Map("catalystFieldPath" -> catalystFieldPath))
}

def cannotFindProtobufFieldInInCatalystError(field: String): Throwable = {
def cannotFindProtobufFieldInCatalystError(field: String): Throwable = {
new AnalysisException(
errorClass = "_LEGACY_ERROR_TEMP_2259",
messageParameters = Map("field" -> field))
Expand Down Expand Up @@ -3340,7 +3340,7 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase {
cause = Some(e1.getCause))
}

def noMessageTypeReturnError(descriptorName: String): Throwable = {
def noProtobufMessageTypeReturnError(descriptorName: String): Throwable = {
new AnalysisException(
errorClass = "_LEGACY_ERROR_TEMP_2264",
messageParameters = Map("descriptorName" -> descriptorName))
Expand Down Expand Up @@ -3379,7 +3379,7 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase {
messageParameters = Map("protobufClassName" -> protobufClassName))
}

def invalidBytStringFormatError(): Throwable = {
def invalidByteStringFormatError(): Throwable = {
new AnalysisException(errorClass = "_LEGACY_ERROR_TEMP_2270", messageParameters = Map.empty)
}

Expand Down

0 comments on commit 70a5983

Please sign in to comment.