| 1661 | } |
| 1662 | |
| 1663 | TypePtr resolveWindowType( |
| 1664 | const std::string& windowFunctionName, |
| 1665 | const std::vector<TypePtr>& inputTypes, |
| 1666 | bool nullOnFailure) { |
| 1667 | if (auto signatures = exec::getWindowFunctionSignatures(windowFunctionName)) { |
| 1668 | for (const auto& signature : signatures.value()) { |
| 1669 | exec::SignatureBinder binder(*signature, inputTypes); |
| 1670 | if (binder.tryBind()) { |
| 1671 | return binder.tryResolveType(signature->returnType()); |
| 1672 | } |
| 1673 | } |
| 1674 | |
| 1675 | if (nullOnFailure) { |
| 1676 | return nullptr; |
| 1677 | } |
| 1678 | throwWindowFunctionSignatureNotSupported( |
| 1679 | windowFunctionName, inputTypes, signatures.value()); |
| 1680 | } |
| 1681 | |
| 1682 | if (nullOnFailure) { |
| 1683 | return nullptr; |
| 1684 | } |
| 1685 | throwWindowFunctionDoesntExist(windowFunctionName); |
| 1686 | return nullptr; |
| 1687 | } |
| 1688 | |
| 1689 | class WindowTypeResolver { |
| 1690 | public: |
no test coverage detected