When we use the CallCopyingArgHandler to copy the sql node tree, we will get OOB.
I find calcite has been supported SqlHint in commit (bf40ad33e7ee85ff426ddc493fe6d9a5bfe6a208).
And the function createCall in SqlSelect has been changed:
operator might be SqlHints array in SqlSelect.
When developer wants to copy the sql node tree using CallCopyingArgHandler. It will call the follow the code:
When the code invoke the "result" method, it will call the SqlSelect::createCall, and pass the call.getOperandList as the dynamic params. But SqlSelect's operator only have 10 operators (not contain hints)