Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-4408

Implement HivePreparedStatement.toString

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 0.10.0
    • None
    • JDBC
    • None

    Description

      I was doing some development using HivePreparedStatement to create queries using JDBC. It would have helped me debug some issues if I could get the generated SQL out from the HivePreparedStatement object.

      Based on the existing code, I believe the following code would work. I have not tested it however, as I had trouble getting hive compiling.

        public String toString() {
          if (sql.contains("?")) {
            return updateSql(sql, parameters);
          }
          return sql;
        } 
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            jackowaya Alan Jackoway
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: