Skip to content

Commit 7e653ff

Browse files
Merge pull request #54 from oslabs-beta/gb/having
fixed having clause in createtableas
2 parents bbf80b7 + c505b3a commit 7e653ff

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

ksqljs/ksqldb/ksqldb.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ const builder = new queryBuilder();
99
class ksqldb {
1010
/**
1111
* Constructor
12-
* @param {object} config
13-
*
14-
* Config object can have these properties
15-
*
12+
* @param {object} config
13+
*
14+
* Config object can have these properties
15+
*
1616
* ksqldbURL: Connection URL or address
17-
*
17+
*
1818
* API: Username or API key for basic authentication
19-
*
19+
*
2020
* secret: Password or secret for basic authentication
21-
*
21+
*
2222
* httpsAgent: httpsAgent for setting TLS properties
2323
*/
2424
constructor(config) {
@@ -249,7 +249,7 @@ class ksqldb {
249249
}
250250

251251
/**
252-
*
252+
*
253253
* @param {string} streamName - the name of the stream to be created
254254
* @param {string[]} selectColumns - the columns from the underlying stream to be included in the new materialized stream
255255
* @param {string} sourceStream - the underlying stream from which the new materialized stream will be created
@@ -347,12 +347,12 @@ class ksqldb {
347347
//---------------------Create tables as select-----------------
348348
/**
349349
* Execute a query to create a new materialized table view of an existing table or stream
350-
*
350+
*
351351
* <p>This method is used to create a materialized table view
352-
*
352+
*
353353
* <p>This method is sql injection protected with the use of queryBuilder.
354-
*
355-
* @param {string} tableName name of the table to be created
354+
*
355+
* @param {string} tableName name of the table to be created
356356
* @param {string} source name of the source stream / table materialized view is based on
357357
* @param {array} selectArray an array that contains the values (strings, aggregate functions) of the columns for the materialized view table
358358
* @param {object} propertiesObj an object containing key value pairs for supported table properties e.g {topic: 'myTopic', value_format: 'json', partitions: '1'}. {} for default values
@@ -365,7 +365,7 @@ class ksqldb {
365365
let selectColStr = selectArray.reduce((result, current) => result + ', ' + current);
366366

367367
// expect user to input properties object of format {topic: ... , value_format: ..., partitions: ...}
368-
// check for properties object, look for properties, if any are missing assign it a default value, if there's no property
368+
// check for properties object, look for properties, if any are missing assign it a default value, if there's no property
369369
const defaultProps = {
370370
topic: tableName,
371371
value_format: 'json',
@@ -397,7 +397,7 @@ class ksqldb {
397397
i += 2;
398398
conditionsArr.shift()
399399
}
400-
conditionQuery = builder.build(`${sqlClauses[0][0]}${sqlClauses[1][0]}????`, sqlClauses[2], sqlClauses[3], sqlClauses[4], sqlClauses[5]);
400+
conditionQuery = builder.build(`${sqlClauses[0][0]}${sqlClauses[1][0]}??${sqlClauses[4][0]}${sqlClauses[5][0]}`, sqlClauses[2], sqlClauses[3]);
401401
}
402402

403403
// reformat for builder

0 commit comments

Comments
 (0)