@@ -484,7 +484,7 @@ case class StringTranslate(srcExpr: Expression, matchingExpr: Expression, replac
484
484
> SELECT _FUNC_('ab','abc,b,ab,c,def');
485
485
3
486
486
""" )
487
- // scalastyle:on
487
+ // scalastyle:on line.size.limit
488
488
case class FindInSet (left : Expression , right : Expression ) extends BinaryExpression
489
489
with ImplicitCastInputTypes {
490
490
@@ -519,16 +519,18 @@ object StringTrim {
519
519
}
520
520
521
521
/**
522
- * A function that takes a character string, removes the leading and trailing characters matching with any character
523
- * in the trim string, returns the new string.
524
- * If BOTH and trimStr keywords are not specified, it defaults to remove space character from both ends. The trim
525
- * function will have one argument, which contains the source string.
526
- * If BOTH and trimStr keywords are specified, it trims the characters from both ends, and the trim function will have
527
- * two arguments, the first argument contains trimStr, the second argument contains the source string.
528
- * trimStr: A character string to be trimmed from the source string, if it has multiple characters, the function
529
- * searches for each character in the source string, removes the characters from the source string until it
530
- * encounters the first non-match character.
531
- * BOTH: removes any character from both ends of the source string that matches characters in the trim string.
522
+ * A function that takes a character string, removes the leading and trailing characters matching
523
+ * with any character in the trim string, returns the new string.
524
+ * If BOTH and trimStr keywords are not specified, it defaults to remove space character from both
525
+ * ends. The trim function will have one argument, which contains the source string.
526
+ * If BOTH and trimStr keywords are specified, it trims the characters from both ends, and the trim
527
+ * function will have two arguments, the first argument contains trimStr, the second argument
528
+ * contains the source string.
529
+ * trimStr: A character string to be trimmed from the source string, if it has multiple characters,
530
+ * the function searches for each character in the source string, removes the characters from the
531
+ * source string until it encounters the first non-match character.
532
+ * BOTH: removes any character from both ends of the source string that matches characters in the
533
+ * trim string.
532
534
*/
533
535
@ ExpressionDescription (
534
536
usage = """
@@ -612,19 +614,22 @@ case class StringTrim(
612
614
}
613
615
614
616
object StringTrimLeft {
615
- def apply (str : Expression , trimStr : Expression ) : StringTrimLeft = StringTrimLeft (str, Some (trimStr))
616
- def apply (str : Expression ) : StringTrimLeft = StringTrimLeft (str, None )
617
+ def apply (str : Expression , trimStr : Expression ): StringTrimLeft =
618
+ StringTrimLeft (str, Some (trimStr))
619
+ def apply (str : Expression ): StringTrimLeft = StringTrimLeft (str, None )
617
620
}
618
621
619
622
/**
620
623
* A function that trims the characters from left end for a given string.
621
- * If LEADING and trimStr keywords are not specified, it defaults to remove space character from the left end. The ltrim
622
- * function will have one argument, which contains the source string.
623
- * If LEADING and trimStr keywords are not specified, it trims the characters from left end. The ltrim function will
624
- * have two arguments, the first argument contains trimStr, the second argument contains the source string.
625
- * trimStr: the function removes any character from the left end of the source string which matches with the characters
626
- * from trimStr, it stops at the first non-match character.
627
- * LEADING: removes any character from the left end of the source string that matches characters in the trim string.
624
+ * If LEADING and trimStr keywords are not specified, it defaults to remove space character from
625
+ * the left end. The ltrim function will have one argument, which contains the source string.
626
+ * If LEADING and trimStr keywords are not specified, it trims the characters from left end. The
627
+ * ltrim function will have two arguments, the first argument contains trimStr, the second argument
628
+ * contains the source string.
629
+ * trimStr: the function removes any character from the left end of the source string which matches
630
+ * with the characters from trimStr, it stops at the first non-match character.
631
+ * LEADING: removes any character from the left end of the source string that matches characters in
632
+ * the trim string.
628
633
*/
629
634
@ ExpressionDescription (
630
635
usage = """
@@ -709,20 +714,24 @@ case class StringTrimLeft(
709
714
}
710
715
711
716
object StringTrimRight {
712
- def apply (str : Expression , trimStr : Expression ) : StringTrimRight = StringTrimRight (str, Some (trimStr))
717
+ def apply (str : Expression , trimStr : Expression ): StringTrimRight =
718
+ StringTrimRight (str, Some (trimStr))
713
719
def apply (str : Expression ) : StringTrimRight = StringTrimRight (str, None )
714
720
}
715
721
716
722
/**
717
723
* A function that trims the characters from right end for a given string.
718
- * If TRAILING and trimStr keywords are not specified, it defaults to remove space character from the right end. The
719
- * rtrim function will have one argument, which contains the source string.
720
- * If TRAILING and trimStr keywords are specified, it trims the characters from right end. The rtrim function will
721
- * have two arguments, the first argument contains trimStr, the second argument contains the source string.
722
- * trimStr: the function removes any character from the right end of source string which matches with the characters
723
- * from trimStr, it stops at the first non-match character.
724
- * TRAILING: removes any character from the right end of the source string that matches characters in the trim string.
724
+ * If TRAILING and trimStr keywords are not specified, it defaults to remove space character
725
+ * from the right end. The rtrim function will have one argument, which contains the source string.
726
+ * If TRAILING and trimStr keywords are specified, it trims the characters from right end. The
727
+ * rtrim function will have two arguments, the first argument contains trimStr, the second argument
728
+ * contains the source string.
729
+ * trimStr: the function removes any character from the right end of source string which matches
730
+ * with the characters from trimStr, it stops at the first non-match character.
731
+ * TRAILING: removes any character from the right end of the source string that matches characters
732
+ * in the trim string.
725
733
*/
734
+ // scalastyle:off line.size.limit
726
735
@ ExpressionDescription (
727
736
usage = """
728
737
_FUNC_(str) - Removes the trailing space characters from `str`.
@@ -741,6 +750,7 @@ object StringTrimRight {
741
750
> SELECT _FUNC_('LQSa', 'SSparkSQLS');
742
751
SSpark
743
752
""" )
753
+ // scalastyle:on line.size.limit
744
754
case class StringTrimRight (
745
755
srcStr : Expression ,
746
756
trimStr : Option [Expression ] = None )
@@ -812,13 +822,15 @@ case class StringTrimRight(
812
822
*
813
823
* NOTE: that this is not zero based, but 1-based index. The first character in str has index 1.
814
824
*/
825
+ // scalastyle:off line.size.limit
815
826
@ ExpressionDescription (
816
827
usage = " _FUNC_(str, substr) - Returns the (1-based) index of the first occurrence of `substr` in `str`." ,
817
828
examples = """
818
829
Examples:
819
830
> SELECT _FUNC_('SparkSQL', 'SQL');
820
831
6
821
832
""" )
833
+ // scalastyle:on line.size.limit
822
834
case class StringInstr (str : Expression , substr : Expression )
823
835
extends BinaryExpression with ImplicitCastInputTypes {
824
836
0 commit comments