Snowflake Connect Null Pointer Error
Hi,
I have setup JDBC properties file, and a batch file to run Anaplan connect. However i get Null Pointer errors, which are quite useless as they do not tell you where the issue is. Please can anyone point me the right way?
My jdbc snowflake properties file is as follows
jdbc❄️// *****.eu-central-1.snowflakecomputing.com/?warehouse=WH_DATAREADER&db=SKUTRAK&schema=PUBLIC
jdbc.username=K**********
jdbc.password=********
jdbc.fetch.size=10
jdbc.isStoredProcedure=false
jdbc.query=SELECT R_DATE,R_SKU,R_SALES_VOLUME FROM "SKUTRAK"."PUBLIC"."OUTPUT_COOP_ESTATE_DAILYSKU_202005"
jdbc.params=ABC,ABC,1234
As far as i can tell this is all correct??
Then my batch file is as follows
@Echooff
set AnaplanUser="********@cyt-uk.com"
set WorkspaceId="***************************"
set ModelId="******************************"
set PrivateKey="M:\Access Databases\ANAPLAN\certs\newcert8b.pem:phrase19"
set CertPath="M:\Access Databases\ANAPLAN\certs\newcertpem.pem"
set ServiceUrl="https://api.anaplan.com"
set AuthUrl="https://auth.anaplan.com"
set ProcessName="importEPOS"
set FileName="coopEpos.csv"
set ChunkSize=1
set ErrorDump="/M:\Access Databases\ANAPLAN\ANAPLAN Upload Error Log"
set jdbcproperties="jdbc-snowflake.properties"
set Operation=-service %ServiceUrl% -auth %AuthUrl% -workspace %WorkspaceID% -model %ModelId% -chunksize %ChunkSize% -file %Filename% -jdbcproperties %jdbcproperties% -process %ProcessName% -execute -output '%ErrorDump%'
rem *** End of settings - Do not edit below this line ***
setlocal enableextensions enabledelayedexpansion || exit /b 1
cd %~dp0
if not %AnaplanUser% == "" set Credentials= -c %CertPath% -pkey %PrivateKey%
set Command=.\AnaplanClient.bat %Credentials% %Operation%
@Echo%Command%
cmd /c %Command%
I use connect for multiple file uploads and processes but this is the first time i have tried to link to snowflake.
thanks
Best Answer
-
@DeveloperCYT, with respect to your .properties file, I have the following thoughts:
ORIG:
jdbc.isStoredProcedure=false
jdbc.query=SELECT R_DATE,R_SKU,R_SALES_VOLUME FROM "SKUTRAK"."PUBLIC"."OUTPUT_COOP_ESTATE_DAILYSKU_202005"
jdbc.params=ABC,ABC,1234
It looks like the jdbc.query line in your .properties file is missing a semi-colon at the end of the line. Without the semi-colon, the query will not know where the line ends.
Also, you have jdbc.isStoredProcedure as false (and there are no placeholder values), but jdbc.params is not commented out. If you don't want to pass the parameters, comment that line out with a #.
PROPOSED:
jdbc.isStoredProcedure=false
jdbc.query=SELECT R_DATE,R_SKU,R_SALES_VOLUME FROM "SKUTRAK"."PUBLIC"."OUTPUT_COOP_ESTATE_DAILYSKU_202005";
#jdbc.params=ABC,ABC,1234
Finally, I assume your .properties file is actually named "jdbc-snowflake.properties" and is the same directory as the batch file being called?
Have you seen this link? https://community.anaplan.com/t5/How-To/Start-Here-Anaplan-Connect-2-0-and-JDBC-Connectivity/ta-p/11...
Hope this helps,
Stacey
1
Answers
-
@DeveloperCYT needs help @ben_speight
0 -
I'm not familiar with Snowflake or the JDBC driver for it but would suggest adding "-debug" to the command line in the first instance to get an idea of where to focus. Anaplan Connect used to produce a stack trace when -debug was specified, but I don't think it does any more - you could try with an older version. If the exception is being thrown inside the JDBC driver, perhaps there is an option (eg a JDBC connection string parameter) to provide some logging/visibility?
One thing that looks possibly wrong is the ErrorDump variable has a leading slash ("/") but I'd be surprised if that resulted in this error.
0