Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-4151

Add string operation function trim, ltrim, rtrim, length to support SparkSql (HiveQL)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 1.1.0
    • 1.5.0
    • SQL
    • None

    Description

      Add three string operation functions to support spark sql and hiveql.
      eg:
      sql("select trim(' a b ') from src ").collect() --> 'a b'
      sql("select ltrim(' a b ') from src ").collect() --> 'a b '
      sql("select rtrim(' a b ') from src ").collect() --> ' a b'
      sql("select length('ab') from src ").collect() --> 2

      And Rename the trait of stringOperations.scala.
      I prefer to rename trait CaseConversionExpression to StringTransformationExpression, it is more make sence than before so that this trait can support more string transformation but not only caseconversion.

      And also add a trait StringCalculationExpression that do string computation like length, indexof etc....

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              OopsOutOfMemory OopsOutOfMemory
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 72h
                  72h
                  Remaining:
                  Remaining Estimate - 72h
                  72h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified