We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi guys. I get this error approximately 50% of cases. And in other 50% of cases everithing is ok. Do you have any ideas what's wrong?
That is my code:
public function transactions(string $accountId, AnalyticTransactionModel $analyticTransactionModel): array { $client = $this->clickhouseClient; $client->cleanQueryDegeneration(); $client->enableQueryConditions(); $client->addQueryDegeneration(new Bindings()); $bindings = [ 'account' => $accountId, ]; if ($analyticTransactionModel->interval !== null) { $bindings['interval'] = $analyticTransactionModel->interval; } if ($analyticTransactionModel->dateFrom !== null) { $bindings['dateFrom'] = $analyticTransactionModel->dateFrom; } if ($analyticTransactionModel->dateTo !== null) { $bindings['dateTo'] = $analyticTransactionModel->dateTo; } if ($analyticTransactionModel->operation !== null) { $bindings['operation'] = $analyticTransactionModel->operation; } if ($analyticTransactionModel->oppositeAccountType !== null) { $bindings['oppositeAccountType'] = $analyticTransactionModel->oppositeAccountType; } if ($analyticTransactionModel->oppositeAccountId !== null) { $bindings['oppositeAccountId'] = $analyticTransactionModel->oppositeAccountId; } $statement = $client->select(' SELECT {if interval} toStartOfInterval(toDateTime(created_at), INTERVAL 1 {interval}) {else} null {/if} as date, account_id, sum(if(operation=\'debit\', points, -points)) as points, sum(if(operation=\'debit\', -value, value)) as value, argMax(current_points, toUnixTimestamp(created_at)) as current_points, argMax(current_balance, toUnixTimestamp(created_at)) as current_balance, count(1) as count_transactions FROM transactions WHERE account_id = :account AND {if dateFrom} created_at >= :dateFrom {else} 1 {/if} AND {if dateTo} created_at <= :dateTo {else} 1 {/if} AND {if operation} operation = :operation {else} 1 {/if} AND {if oppositeAccountType} opposite_account_type = :oppositeAccountType {else} 1 {/if} AND {if oppositeAccountId} opposite_account_id = :oppositeAccountId {else} 1 {/if} GROUP BY account_id {if interval} , date {/if} ORDER BY account_id {if interval}, date {/if} ', $bindings); return $statement->rows(); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi guys. I get this error approximately 50% of cases. And in other 50% of cases everithing is ok.
Do you have any ideas what's wrong?
That is my code:
The text was updated successfully, but these errors were encountered: