'Athena View doesn't return rows when accessing it in AWS glue

I am currently trying to use athena view in AWS glue. Below is the code:

DataSource0 = (
    glueContext.read.format("jdbc")
    .option("AwsCredentialsProviderClass","com.simba.athena.amazonaws.auth.InstanceProfileCredentialsProvider")
    .option("driver", "com.simba.athena.jdbc.Driver")
    .option("url", "jdbc:awsathena://athena.us-east-1.amazonaws.com:443")
    .option("dbtable", 'AwsDataCatalog."silver".vw_xyz')
    .option("S3OutputLocation","s3://datadrop-test/xyz/")
    .load()
    )
DataSource0.printSchema()

Driver version=AthenaJDBC42_2.0.25.1002

The following output files(size<1kb) are generated

enter image description here

The files only contain columns. It seems like glue is unable to get records from view. The same view returns multiple rows in athena. Any help will be highly appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source