Azure DataLake Query Expression | Error Processing Query

Viewed 156

I got some data in blob storage under data lake in CSV, data format is

mail,usertype,license

Data is huge, so I'm implementing pagination in Django to render it, I don't want my compute unit to fetch all half a mil rows every time which makes the website slow. To improve pagination. Right now when I am querying data based on rows with limit then I'm getting an error

Syntax error!
RequestId:59f9d9e5-601e-0015-4f0f-64fd1d000000
Time:2021-06-18T06:56:56.9344470Z
ErrorCode:ErrorProcessingQueryExpression
Error:None

Here's my query to pick data of the 5th to 10th row for a test.

query_expression = "SELECT * from DataLakeStorage limit 5,10"

Updating the question,

I updated the query but in Azure Data Lake but getting errors, seems Datalake is using uSQL

filesystem_client = service_client.get_file_system_client(
            filesystem_name)
        file_client = service_client.get_file_client(
            filesystem_name, "csvfile.csv")
        query_expression = 'SELECT * from DataLakeStorage ORDER BY mail LIMIT 5, 10'
        # reader = file_client.query_file(query_expression)
        input_format = DelimitedTextDialect(
            delimiter=",",
            lineterminator="\n",
            escapechar="",
            has_header=True,
        )
        output_format = DelimitedJsonDialect(delimiter="\n")
        reader = file_client.query_file(
            query_expression,
            file_format=input_format,
            # output_format=output_format,
        )
        # [END query]
        content = reader.readall()
        content = content.decode('utf-8')

and here's the error which i am getting

syntax error!
RequestId:6d868cb6-701e-008f-10af-6663c4000000
Time:2021-06-21T15:10:12.6586583Z
ErrorCode:ErrorProcessingQueryExpression
Error:None
0 Answers
Related