Vibav Mahendran
Vibav Mahendran

Reputation: 29

How to intercept Spark SQL queries

I am working on modifying the Apache Spark source code to capture SQL queries executed using spark.sql() at runtime, modify them (if needed), and then execute the modified SQL.

Requirements:

I tried modifying several listener classes, but they mostly display logical/physical plans instead of raw SQL. Files I Have Modified (But Not Working as Expected)

  1. SparkFirehoseListener.java
  2. SQLListener.scala
  3. QueryExecutionListener.scala

These files mostly log query plans rather than capturing the raw SQL at runtime.

Upvotes: 2

Views: 43

Answers (1)

Matt Andruff
Matt Andruff

Reputation: 5135

It seems to me that you might need to extend this Abstract Scala class

Upvotes: 0

Related Questions