How can I execute lengthy, multiline Hive Queries in Spark SQL? Like query below:
val sqlContext = new HiveContext (sc) val result = sqlContext.sql (" select ... from ... ");
Use """ instead, so for example
val results = sqlContext.sql (""" select .... from .... """);
or, if you want to format code, use:
val results = sqlContext.sql (""" |select .... |from .... """.stripMargin);
2.1m questions
2.1m answers
60 comments
57.0k users