aliyun/aliyun-log-java-sdk

The 'line' does not work when 'query' cotains '| select ....'

sunyl527 opened this issue · 2 comments

eg:
int log_offset = 0;
int log_line = 10;
String query = " key=value1 | select id,key ";
Client logtailClient = new Client(endpoint, accessKeyId, accessKeySecret);
GetLogsRequest logsRequest = new GetLogsRequest(project, logstore, from, to, "", query, log_offset, log_line, true);
GetLogsResponse logsResponse = logtailClient.GetLogs(logsRequest);
int count = logsResponse.GetCount();

If the total count of the logs >= 100, the value of count will be 100 rather than 10.
but the String query = " key=value | select id,key limit 0,10 "; works.
May it be a bug?

Thanks @sunyl527 . Currently, the offset and line parameters cannot be used in sql query. Please take a look at this document: https://help.aliyun.com/document_detail/89994.html?spm=a2c4g.11186623.6.835.118612cbek3zti
And yes, as you found, please use the keyword limit in sql.

Thanks @sunyl527 . Currently, the offset and line parameters cannot be used in sql query. Please take a look at this document: https://help.aliyun.com/document_detail/89994.html?spm=a2c4g.11186623.6.835.118612cbek3zti
And yes, as you found, please use the keyword limit in sql.

Thanks!
By the way, it seems that I need to use the function GetTotalCount of GetHistogramsResponse to query again, in order to getting the total count of query result.
Hoping it would be more flexible ~