This is an automated email from the ASF dual-hosted git repository. gurwls223 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push: new b5036bd6de5 [SPARK-41334][CONNECT][PYTHON][FOLLOWUP] Add the missing `UNSPECIFIED` in enum b5036bd6de5 is described below commit b5036bd6de52cf8569f5b4dd6835f522ed22a269 Author: Ruifeng Zheng <ruife...@apache.org> AuthorDate: Sun Dec 25 19:53:06 2022 +0900 [SPARK-41334][CONNECT][PYTHON][FOLLOWUP] Add the missing `UNSPECIFIED` in enum ### What changes were proposed in this pull request? add `SORT_DIRECTION_UNSPECIFIED ` and `SORT_NULLS_UNSPECIFIED ` removed in https://github.com/apache/spark/pull/39090 ### Why are the changes needed? this is required in [proto style guide ](https://developers.google.com/protocol-buffers/docs/style): > The zero value enum should have the suffix UNSPECIFIED. ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? existing UT Closes #39208 from zhengruifeng/connect_sort_order_followup. Authored-by: Ruifeng Zheng <ruife...@apache.org> Signed-off-by: Hyukjin Kwon <gurwls...@apache.org> --- .../main/protobuf/spark/connect/expressions.proto | 10 ++-- .../pyspark/sql/connect/proto/expressions_pb2.py | 56 +++++++++++----------- .../pyspark/sql/connect/proto/expressions_pb2.pyi | 20 ++++---- 3 files changed, 46 insertions(+), 40 deletions(-) diff --git a/connector/connect/common/src/main/protobuf/spark/connect/expressions.proto b/connector/connect/common/src/main/protobuf/spark/connect/expressions.proto index 4062e20d332..65cf9291a2f 100644 --- a/connector/connect/common/src/main/protobuf/spark/connect/expressions.proto +++ b/connector/connect/common/src/main/protobuf/spark/connect/expressions.proto @@ -113,13 +113,15 @@ message Expression { NullOrdering null_ordering = 3; enum SortDirection { - SORT_DIRECTION_ASCENDING = 0; - SORT_DIRECTION_DESCENDING = 1; + SORT_DIRECTION_UNSPECIFIED = 0; + SORT_DIRECTION_ASCENDING = 1; + SORT_DIRECTION_DESCENDING = 2; } enum NullOrdering { - SORT_NULLS_FIRST = 0; - SORT_NULLS_LAST = 1; + SORT_NULLS_UNSPECIFIED = 0; + SORT_NULLS_FIRST = 1; + SORT_NULLS_LAST = 2; } } diff --git a/python/pyspark/sql/connect/proto/expressions_pb2.py b/python/pyspark/sql/connect/proto/expressions_pb2.py index 3b948b71a0e..9e5b887348c 100644 --- a/python/pyspark/sql/connect/proto/expressions_pb2.py +++ b/python/pyspark/sql/connect/proto/expressions_pb2.py @@ -33,7 +33,7 @@ from pyspark.sql.connect.proto import types_pb2 as spark_dot_connect_dot_types__ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x1fspark/connect/expressions.proto\x12\rspark.connect\x1a\x19spark/connect/types.proto"\xeb\x1d\n\nExpression\x12=\n\x07literal\x18\x01 \x01(\x0b\x32!.spark.connect.Expression.LiteralH\x00R\x07literal\x12\x62\n\x14unresolved_attribute\x18\x02 \x01(\x0b\x32-.spark.connect.Expression.UnresolvedAttributeH\x00R\x13unresolvedAttribute\x12_\n\x13unresolved_function\x18\x03 \x01(\x0b\x32,.spark.connect.Expression.UnresolvedFunctionH\x00R\x12unresolvedFunction\x12Y\n\x11\x65xpression_st [...] + b'\n\x1fspark/connect/expressions.proto\x12\rspark.connect\x1a\x19spark/connect/types.proto"\xa7\x1e\n\nExpression\x12=\n\x07literal\x18\x01 \x01(\x0b\x32!.spark.connect.Expression.LiteralH\x00R\x07literal\x12\x62\n\x14unresolved_attribute\x18\x02 \x01(\x0b\x32-.spark.connect.Expression.UnresolvedAttributeH\x00R\x13unresolvedAttribute\x12_\n\x13unresolved_function\x18\x03 \x01(\x0b\x32,.spark.connect.Expression.UnresolvedFunctionH\x00R\x12unresolvedFunction\x12Y\n\x11\x65xpression_st [...] ) @@ -226,7 +226,7 @@ if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b"\n\036org.apache.spark.connect.protoP\001" _EXPRESSION._serialized_start = 78 - _EXPRESSION._serialized_end = 3897 + _EXPRESSION._serialized_end = 3957 _EXPRESSION_WINDOW._serialized_start = 943 _EXPRESSION_WINDOW._serialized_end = 1726 _EXPRESSION_WINDOW_WINDOWFRAME._serialized_start = 1233 @@ -236,31 +236,31 @@ if _descriptor._USE_C_DESCRIPTORS == False: _EXPRESSION_WINDOW_WINDOWFRAME_FRAMETYPE._serialized_start = 1647 _EXPRESSION_WINDOW_WINDOWFRAME_FRAMETYPE._serialized_end = 1726 _EXPRESSION_SORTORDER._serialized_start = 1729 - _EXPRESSION_SORTORDER._serialized_end = 2094 + _EXPRESSION_SORTORDER._serialized_end = 2154 _EXPRESSION_SORTORDER_SORTDIRECTION._serialized_start = 1959 - _EXPRESSION_SORTORDER_SORTDIRECTION._serialized_end = 2035 - _EXPRESSION_SORTORDER_NULLORDERING._serialized_start = 2037 - _EXPRESSION_SORTORDER_NULLORDERING._serialized_end = 2094 - _EXPRESSION_CAST._serialized_start = 2097 - _EXPRESSION_CAST._serialized_end = 2242 - _EXPRESSION_LITERAL._serialized_start = 2245 - _EXPRESSION_LITERAL._serialized_end = 3240 - _EXPRESSION_LITERAL_DECIMAL._serialized_start = 3007 - _EXPRESSION_LITERAL_DECIMAL._serialized_end = 3124 - _EXPRESSION_LITERAL_CALENDARINTERVAL._serialized_start = 3126 - _EXPRESSION_LITERAL_CALENDARINTERVAL._serialized_end = 3224 - _EXPRESSION_UNRESOLVEDATTRIBUTE._serialized_start = 3242 - _EXPRESSION_UNRESOLVEDATTRIBUTE._serialized_end = 3312 - _EXPRESSION_UNRESOLVEDFUNCTION._serialized_start = 3315 - _EXPRESSION_UNRESOLVEDFUNCTION._serialized_end = 3519 - _EXPRESSION_EXPRESSIONSTRING._serialized_start = 3521 - _EXPRESSION_EXPRESSIONSTRING._serialized_end = 3571 - _EXPRESSION_UNRESOLVEDSTAR._serialized_start = 3573 - _EXPRESSION_UNRESOLVEDSTAR._serialized_end = 3613 - _EXPRESSION_UNRESOLVEDREGEX._serialized_start = 3615 - _EXPRESSION_UNRESOLVEDREGEX._serialized_end = 3659 - _EXPRESSION_ALIAS._serialized_start = 3661 - _EXPRESSION_ALIAS._serialized_end = 3781 - _EXPRESSION_LAMBDAFUNCTION._serialized_start = 3783 - _EXPRESSION_LAMBDAFUNCTION._serialized_end = 3884 + _EXPRESSION_SORTORDER_SORTDIRECTION._serialized_end = 2067 + _EXPRESSION_SORTORDER_NULLORDERING._serialized_start = 2069 + _EXPRESSION_SORTORDER_NULLORDERING._serialized_end = 2154 + _EXPRESSION_CAST._serialized_start = 2157 + _EXPRESSION_CAST._serialized_end = 2302 + _EXPRESSION_LITERAL._serialized_start = 2305 + _EXPRESSION_LITERAL._serialized_end = 3300 + _EXPRESSION_LITERAL_DECIMAL._serialized_start = 3067 + _EXPRESSION_LITERAL_DECIMAL._serialized_end = 3184 + _EXPRESSION_LITERAL_CALENDARINTERVAL._serialized_start = 3186 + _EXPRESSION_LITERAL_CALENDARINTERVAL._serialized_end = 3284 + _EXPRESSION_UNRESOLVEDATTRIBUTE._serialized_start = 3302 + _EXPRESSION_UNRESOLVEDATTRIBUTE._serialized_end = 3372 + _EXPRESSION_UNRESOLVEDFUNCTION._serialized_start = 3375 + _EXPRESSION_UNRESOLVEDFUNCTION._serialized_end = 3579 + _EXPRESSION_EXPRESSIONSTRING._serialized_start = 3581 + _EXPRESSION_EXPRESSIONSTRING._serialized_end = 3631 + _EXPRESSION_UNRESOLVEDSTAR._serialized_start = 3633 + _EXPRESSION_UNRESOLVEDSTAR._serialized_end = 3673 + _EXPRESSION_UNRESOLVEDREGEX._serialized_start = 3675 + _EXPRESSION_UNRESOLVEDREGEX._serialized_end = 3719 + _EXPRESSION_ALIAS._serialized_start = 3721 + _EXPRESSION_ALIAS._serialized_end = 3841 + _EXPRESSION_LAMBDAFUNCTION._serialized_start = 3843 + _EXPRESSION_LAMBDAFUNCTION._serialized_end = 3944 # @@protoc_insertion_point(module_scope) diff --git a/python/pyspark/sql/connect/proto/expressions_pb2.pyi b/python/pyspark/sql/connect/proto/expressions_pb2.pyi index 8c66512750d..3540a563726 100644 --- a/python/pyspark/sql/connect/proto/expressions_pb2.pyi +++ b/python/pyspark/sql/connect/proto/expressions_pb2.pyi @@ -249,12 +249,14 @@ class Expression(google.protobuf.message.Message): builtins.type, ): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - SORT_DIRECTION_ASCENDING: Expression.SortOrder._SortDirection.ValueType # 0 - SORT_DIRECTION_DESCENDING: Expression.SortOrder._SortDirection.ValueType # 1 + SORT_DIRECTION_UNSPECIFIED: Expression.SortOrder._SortDirection.ValueType # 0 + SORT_DIRECTION_ASCENDING: Expression.SortOrder._SortDirection.ValueType # 1 + SORT_DIRECTION_DESCENDING: Expression.SortOrder._SortDirection.ValueType # 2 class SortDirection(_SortDirection, metaclass=_SortDirectionEnumTypeWrapper): ... - SORT_DIRECTION_ASCENDING: Expression.SortOrder.SortDirection.ValueType # 0 - SORT_DIRECTION_DESCENDING: Expression.SortOrder.SortDirection.ValueType # 1 + SORT_DIRECTION_UNSPECIFIED: Expression.SortOrder.SortDirection.ValueType # 0 + SORT_DIRECTION_ASCENDING: Expression.SortOrder.SortDirection.ValueType # 1 + SORT_DIRECTION_DESCENDING: Expression.SortOrder.SortDirection.ValueType # 2 class _NullOrdering: ValueType = typing.NewType("ValueType", builtins.int) @@ -267,12 +269,14 @@ class Expression(google.protobuf.message.Message): builtins.type, ): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - SORT_NULLS_FIRST: Expression.SortOrder._NullOrdering.ValueType # 0 - SORT_NULLS_LAST: Expression.SortOrder._NullOrdering.ValueType # 1 + SORT_NULLS_UNSPECIFIED: Expression.SortOrder._NullOrdering.ValueType # 0 + SORT_NULLS_FIRST: Expression.SortOrder._NullOrdering.ValueType # 1 + SORT_NULLS_LAST: Expression.SortOrder._NullOrdering.ValueType # 2 class NullOrdering(_NullOrdering, metaclass=_NullOrderingEnumTypeWrapper): ... - SORT_NULLS_FIRST: Expression.SortOrder.NullOrdering.ValueType # 0 - SORT_NULLS_LAST: Expression.SortOrder.NullOrdering.ValueType # 1 + SORT_NULLS_UNSPECIFIED: Expression.SortOrder.NullOrdering.ValueType # 0 + SORT_NULLS_FIRST: Expression.SortOrder.NullOrdering.ValueType # 1 + SORT_NULLS_LAST: Expression.SortOrder.NullOrdering.ValueType # 2 CHILD_FIELD_NUMBER: builtins.int DIRECTION_FIELD_NUMBER: builtins.int --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org