@@ -133,8 +133,25 @@ case class Not(child: Expression)
133133/**
134134 * Evaluates to `true` if `list` contains `value`.
135135 */
136+ // scalastyle:off line.size.limit
136137@ ExpressionDescription (
137- usage = " expr1 _FUNC_(expr2, expr3, ...) - Returns true if `expr` equals to any valN." )
138+ usage = " expr1 _FUNC_(expr2, expr3, ...) - Returns true if `expr` equals to any valN." ,
139+ arguments = """
140+ Arguments:
141+ * expr1, expr2, expr3, ... - the arguments must be same type.
142+ """ ,
143+ examples = """
144+ Examples:
145+ > SELECT 1 _FUNC_(1, 2, 3);
146+ true
147+ > SELECT 1 _FUNC_(2, 3, 4);
148+ false
149+ > SELECT named_struct('a', 1, 'b', 2) _FUNC_(named_struct('a', 1, 'b', 1), named_struct('a', 1, 'b', 3));
150+ false
151+ > SELECT named_struct('a', 1, 'b', 2) _FUNC_(named_struct('a', 1, 'b', 2), named_struct('a', 1, 'b', 3));
152+ true
153+ """ )
154+ // scalastyle:on line.size.limit
138155case class In (value : Expression , list : Seq [Expression ]) extends Predicate {
139156
140157 require(list != null , " list should not be null" )
@@ -491,7 +508,24 @@ object Equality {
491508// TODO: although map type is not orderable, technically map type should be able to be used
492509// in equality comparison
493510@ ExpressionDescription (
494- usage = " expr1 _FUNC_ expr2 - Returns true if `expr1` equals `expr2`, or false otherwise." )
511+ usage = " expr1 _FUNC_ expr2 - Returns true if `expr1` equals `expr2`, or false otherwise." ,
512+ arguments = """
513+ Arguments:
514+ * expr1, expr2 - the two expressions must be same type or can be casted to a common type,
515+ and must be a type that can be used in equality comparison. Map type is not supported.
516+ For complex types such array/struct, the data types of fields must be orderable.
517+ """ ,
518+ examples = """
519+ Examples:
520+ > SELECT 2 _FUNC_ 2;
521+ true
522+ > SELECT 1 _FUNC_ '1';
523+ true
524+ > SELECT true _FUNC_ NULL;
525+ NULL
526+ > SELECT NULL _FUNC_ NULL;
527+ NULL
528+ """ )
495529case class EqualTo (left : Expression , right : Expression )
496530 extends BinaryComparison with NullIntolerant {
497531
@@ -510,6 +544,23 @@ case class EqualTo(left: Expression, right: Expression)
510544 usage = """
511545 expr1 _FUNC_ expr2 - Returns same result as the EQUAL(=) operator for non-null operands,
512546 but returns true if both are null, false if one of the them is null.
547+ """ ,
548+ arguments = """
549+ Arguments:
550+ * expr1, expr2 - the two expressions must be same type or can be casted to a common type,
551+ and must be a type that can be used in equality comparison. Map type is not supported.
552+ For complex types such array/struct, the data types of fields must be orderable.
553+ """ ,
554+ examples = """
555+ Examples:
556+ > SELECT 2 _FUNC_ 2;
557+ true
558+ > SELECT 1 _FUNC_ '1';
559+ true
560+ > SELECT true _FUNC_ NULL;
561+ false
562+ > SELECT NULL _FUNC_ NULL;
563+ true
513564 """ )
514565case class EqualNullSafe (left : Expression , right : Expression ) extends BinaryComparison {
515566
@@ -540,7 +591,27 @@ case class EqualNullSafe(left: Expression, right: Expression) extends BinaryComp
540591}
541592
542593@ ExpressionDescription (
543- usage = " expr1 _FUNC_ expr2 - Returns true if `expr1` is less than `expr2`." )
594+ usage = " expr1 _FUNC_ expr2 - Returns true if `expr1` is less than `expr2`." ,
595+ arguments = """
596+ Arguments:
597+ * expr1, expr2 - the two expressions must be same type or can be casted to a common type,
598+ and must be a type that can be ordered. For example, map type is not orderable, so it
599+ is not supported. For complex types such array/struct, the data types of fields must
600+ be orderable.
601+ """ ,
602+ examples = """
603+ Examples:
604+ > SELECT 1 _FUNC_ 2;
605+ true
606+ > SELECT 1.1 _FUNC_ '1';
607+ false
608+ > SELECT to_date('2009-07-30 04:17:52') _FUNC_ to_date('2009-07-30 04:17:52');
609+ false
610+ > SELECT to_date('2009-07-30 04:17:52') _FUNC_ to_date('2009-08-01 04:17:52');
611+ true
612+ > SELECT 1 _FUNC_ NULL;
613+ NULL
614+ """ )
544615case class LessThan (left : Expression , right : Expression )
545616 extends BinaryComparison with NullIntolerant {
546617
@@ -550,7 +621,27 @@ case class LessThan(left: Expression, right: Expression)
550621}
551622
552623@ ExpressionDescription (
553- usage = " expr1 _FUNC_ expr2 - Returns true if `expr1` is less than or equal to `expr2`." )
624+ usage = " expr1 _FUNC_ expr2 - Returns true if `expr1` is less than or equal to `expr2`." ,
625+ arguments = """
626+ Arguments:
627+ * expr1, expr2 - the two expressions must be same type or can be casted to a common type,
628+ and must be a type that can be ordered. For example, map type is not orderable, so it
629+ is not supported. For complex types such array/struct, the data types of fields must
630+ be orderable.
631+ """ ,
632+ examples = """
633+ Examples:
634+ > SELECT 2 _FUNC_ 2;
635+ true
636+ > SELECT 1.0 _FUNC_ '1';
637+ true
638+ > SELECT to_date('2009-07-30 04:17:52') _FUNC_ to_date('2009-07-30 04:17:52');
639+ true
640+ > SELECT to_date('2009-07-30 04:17:52') _FUNC_ to_date('2009-08-01 04:17:52');
641+ true
642+ > SELECT 1 _FUNC_ NULL;
643+ NULL
644+ """ )
554645case class LessThanOrEqual (left : Expression , right : Expression )
555646 extends BinaryComparison with NullIntolerant {
556647
@@ -560,7 +651,27 @@ case class LessThanOrEqual(left: Expression, right: Expression)
560651}
561652
562653@ ExpressionDescription (
563- usage = " expr1 _FUNC_ expr2 - Returns true if `expr1` is greater than `expr2`." )
654+ usage = " expr1 _FUNC_ expr2 - Returns true if `expr1` is greater than `expr2`." ,
655+ arguments = """
656+ Arguments:
657+ * expr1, expr2 - the two expressions must be same type or can be casted to a common type,
658+ and must be a type that can be ordered. For example, map type is not orderable, so it
659+ is not supported. For complex types such array/struct, the data types of fields must
660+ be orderable.
661+ """ ,
662+ examples = """
663+ Examples:
664+ > SELECT 2 _FUNC_ 1;
665+ true
666+ > SELECT 2 _FUNC_ '1.1';
667+ true
668+ > SELECT to_date('2009-07-30 04:17:52') _FUNC_ to_date('2009-07-30 04:17:52');
669+ false
670+ > SELECT to_date('2009-07-30 04:17:52') _FUNC_ to_date('2009-08-01 04:17:52');
671+ false
672+ > SELECT 1 _FUNC_ NULL;
673+ NULL
674+ """ )
564675case class GreaterThan (left : Expression , right : Expression )
565676 extends BinaryComparison with NullIntolerant {
566677
@@ -570,7 +681,27 @@ case class GreaterThan(left: Expression, right: Expression)
570681}
571682
572683@ ExpressionDescription (
573- usage = " expr1 _FUNC_ expr2 - Returns true if `expr1` is greater than or equal to `expr2`." )
684+ usage = " expr1 _FUNC_ expr2 - Returns true if `expr1` is greater than or equal to `expr2`." ,
685+ arguments = """
686+ Arguments:
687+ * expr1, expr2 - the two expressions must be same type or can be casted to a common type,
688+ and must be a type that can be ordered. For example, map type is not orderable, so it
689+ is not supported. For complex types such array/struct, the data types of fields must
690+ be orderable.
691+ """ ,
692+ examples = """
693+ Examples:
694+ > SELECT 2 _FUNC_ 1;
695+ true
696+ > SELECT 2.0 _FUNC_ '2.1';
697+ false
698+ > SELECT to_date('2009-07-30 04:17:52') _FUNC_ to_date('2009-07-30 04:17:52');
699+ true
700+ > SELECT to_date('2009-07-30 04:17:52') _FUNC_ to_date('2009-08-01 04:17:52');
701+ false
702+ > SELECT 1 _FUNC_ NULL;
703+ NULL
704+ """ )
574705case class GreaterThanOrEqual (left : Expression , right : Expression )
575706 extends BinaryComparison with NullIntolerant {
576707
0 commit comments