* Gets a single cql function or aggregate definition * @param {String} keyspaceName * @param {String} name * @param {Array} signature * @param {Boolean} aggregate * @returns {Promise } * @private
(keyspaceName, name, signature, aggregate)
| 708 | * @private |
| 709 | */ |
| 710 | async _getSingleFunction(keyspaceName, name, signature, aggregate) { |
| 711 | if (!keyspaceName || !name) { |
| 712 | throw new errors.ArgumentError('You must provide the keyspace name and cql function name to retrieve the metadata'); |
| 713 | } |
| 714 | if (!Array.isArray(signature)) { |
| 715 | throw new errors.ArgumentError('Signature must be an array of types'); |
| 716 | } |
| 717 | signature = signature.map(item => { |
| 718 | if (typeof item === 'string') { |
| 719 | return item; |
| 720 | } |
| 721 | return types.getDataTypeNameByCode(item); |
| 722 | }); |
| 723 | const functionsMap = await this._getFunctions(keyspaceName, name, aggregate); |
| 724 | return functionsMap.get(signature.join(',')) || null; |
| 725 | } |
| 726 | |
| 727 | /** |
| 728 | * Gets the trace session generated by Cassandra when query tracing is enabled for the |
no test coverage detected