Closed shawnlu-ikigai closed 10 months ago
I checked PgPreparedStatement.java for postgres and found there is a toString method:
public String toString() {
if (preparedQuery == null) {
return super.toString();
}
return preparedQuery.query.toString(preparedParameters);
}
There is no toString
method in SnowflakePreparedStatementV1.java
. adding that method might fix the issue already.
That's my assumption. Hoping it will helps.
@shawnlu-ikigai thanks for reporting this. Would you agree that this is more of an enhancement request rather than a bug? I think that output you're seeing is exactly because as you pointed out, we didn't override the toString() method, so it should theoretically be a straightforward thing to implement to address your problem. I'll take a look.
Hi @sfc-gh-wfateem Thank you for timely response. Yes, enhancement makes more sense.
@shawnlu-ikigai I made the change and test it locally so PR #1604 will address your problem. However, I just had an after thought and I think I can improve on this by adding a query ID in addition to the SQL text.
Do you think that will be helpful as well?
@sfc-gh-wfateem that's really quick man. Yeah query ID for sure will help. When do you think this will be merged and pushed to mvnrepository?
@shawnlu-ikigai the change was just merged but it's past the code freeze for January's release, so this will make its way in the JDBC driver's February release.
Please answer these questions before submitting your issue. In order to accurately debug the issue this information is required. Thanks!
What version of JDBC driver are you using? 3.14.3
What operating system and processor architecture are you using? Mac
What version of Java are you using? java17
What did you do? I am following this page: https://vladmihalcea.com/hibernate-slow-query-log/ I added following config for a spring boot application:
What did you expect to see?
I am expecting to see the SQL execute:
However, What I am seeing looks as following:
Can you set logging to DEBUG and collect the logs?
https://community.snowflake.com/s/article/How-to-generate-log-file-on-Snowflake-connectors
What is your Snowflake account identifier, if any? (Optional)