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);
1.4m articles
1.4m replys
5 comments
57.0k users