Unable to retrieve all the records from snowflake using snowflake-jdbc driver. but issue is not exists in snowflake browser

i was trying to compare sql server and Snowflake result sets using respective JDBC connectors. But snowflake results were not given all records if records count greater than 3+ lacks. Missing a lot many records.

Ex:i am executing scripts for the date range (2000-01-01 to 2020-12-31) and internal query is executing day by day. For some random days snowflake results set count and SQL server results set counts do not match.

Note: Data are available in Snowflake but while retrieving through Snowflake-jdbc connector, it is not fetching all the records

SnowFlake version:5.33.1 SnowFlake-JDBC connector version-3.13.6

sample code:

public static int countsnowfalkeVar=0;

public static int countsqlVar=0;

ResultsSet SqlSet=Select * from sqlServequery

ResultsSet SnowflakeSet=Select * from snowflakeQuery

while(SnowflakeSet.next())

{

for (int columnCount = 1; columnCount <= numberOfColumns1; columnCount++) {

snowFlakeal.add(SnowflakeSet.getString(columnCount));

}

countsnowfalkeVar++;

}

while(SqlSet.next())

{

for (int columnCount = 1; columnCount <= numberOfColumns1; columnCount++) {

snowFlakeal.add(SqlSet.getString(columnCount));

}

countsqlVar++;

}

 

o/p: countsqlVar= 440687

countsnowfalkeVar=418259

 

Hi @mounika.hkr​ and thanks so much for posting. If you could let us know the contents of the query that would help me get an answer for you, or at least the LIMIT, WHERE and/or TOP clauses.

Also the team has noticed a couple of possible issues in your sample code, they've said to check lines 13 and 22 as it looks like you're adding the column counts for both the Snowflake and SQL result sets into the same variable.

Let us know if the above helps and let us know the clauses and we can try to help you further.

Many thanks, Claire