1

I am using Spark 2.4 and running below query,

select ID from WEB_TBL where ID NOT LIKE '%-%'

This query is giving proper output in Spark-shell but when I am running through Java class, its throwing below error.

ERROR ApplicationMaster: User class threw exception: java.util.MissingFormatWidthException: %-%

IS there something we need to do, while running spark-submit to execute this query. or can anyone suggest alternative for this query

Kalpesh
  • 694
  • 2
  • 8
  • 28

1 Answers1

0

Not sure about the code, I tried locally with a java test case, working well for me-

 @Test
    public void test62410606() {
        spark.sql("select ID from values ('1-1'), ('10') T(ID) where ID NOT LIKE '%-%'")
                .show(false);
        /**
         * +---+
         * |ID |
         * +---+
         * |10 |
         * +---+
         */
    }
Som
  • 6,193
  • 1
  • 11
  • 22
  • I don't know what is the problem with my code, as I am able to see the results if I run the same query on spark-shell but some how it is failing if I am running through class and do spark-submit. – Kalpesh Jun 18 '20 at 16:08