You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ksqljs/ksqlJS.js
+15Lines changed: 15 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -306,6 +306,20 @@ class ksqljs {
306
306
}
307
307
308
308
//---------------------Create tables as select-----------------
309
+
/**
310
+
* Execute a query to create a new materialized table view of an existing table or stream
311
+
*
312
+
* <p>This method is used to create a materialized table view
313
+
*
314
+
* <p>This method is sql injection protected with the use of queryBuilder.
315
+
*
316
+
* @param {string} tableName name of the table to be created
317
+
* @param {string} source name of the source stream / table materialized view is based on
318
+
* @param {array} selectArray an array that contains the values (strings, aggregate functions) of the columns for the materialized view table
319
+
* @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
320
+
* @param {object} conditionsObj an object containing key value pairs for supported query conditions e.g {WHERE: 'a is not null', GROUP_BY: 'profileID', HAVING: 'COUNT(a) > 5' }
321
+
* @returns {Promise} a promise that completes once the server response is received, returning a response object
awaitclient.ksql('CREATE STREAM RIDERLOCATIONS (PROFILEID VARCHAR, LATITUDE DOUBLE, LONGITUDE DOUBLE) WITH (KAFKA_TOPIC=\'locations\', value_format=\'json\', partitions=1);')
91
-
awaitclient.createTableAs('currentLocation','riderlocations',['profileId','LATEST_BY_OFFSET(latitude) AS la','LATEST_BY_OFFSET(longitude) AS lo'],{},{GROUP_BY: 'profileId'})
90
+
// await client.ksql('CREATE STREAM RIDERLOCATIONS (PROFILEID VARCHAR, LATITUDE DOUBLE, LONGITUDE DOUBLE) WITH (KAFKA_TOPIC=\'locations\', value_format=\'json\', partitions=1);')
91
+
// await client.createTableAs('currentlocation', 'riderlocations', ['profileid','LATEST_BY_OFFSET(latitude) AS la', 'LATEST_BY_OFFSET(longitude) AS lo'], {}, {GROUP_BY: 'profileId'})
92
92
// let x;
93
-
// x = await client.push('SELECT * FROM CURRENTLOCATION EMIT CHANGES LIMIT 20;', async (data) => {
0 commit comments