Skip to content
New issue

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

support benchmark function #228

Open
tuichenchuxin opened this issue Jan 7, 2025 · 0 comments
Open

support benchmark function #228

tuichenchuxin opened this issue Jan 7, 2025 · 0 comments

Comments

@tuichenchuxin
Copy link

我想支持下 benchmark function,例如

SELECT BENCHMARK(30000, (SELECT id from test limit 1));

SELECT BENCHMARK(100, (AES_ENCRYPT('HELLO', 'WORLD')))

我发现了BenchmarkVectorizedExpression 这个类,但是 debug 的时候,发现children[1] 的(SELECT id from test limit 1) 被解析成了 InputRefVectorizedExpression ,这样实际计算的时候走的如下方法,不会真正运行多次,在 if 判断处就返回了。

    public void eval(EvaluationContext ctx) {
        if (outputIndex != inputIndex) {
            MutableChunk chunk = ctx.getPreAllocatedChunk();
            boolean isSelectionInUse = chunk.isSelectionInUse();
            int[] selection = chunk.selection();
            chunk.slotIn(outputIndex).copySelected(isSelectionInUse, selection, chunk.batchSize(),
                chunk.slotIn(inputIndex));
        }
    }
    ```
    
    另外运行 SELECT BENCHMARK(100, (AES_ENCRYPT('HELLO', 'WORLD'))) 提示不支持 BENCHMARK 方法社区大佬们可以提示下支持的思路么我非常愿意提交这个 pr 来支持
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant