Hi team, i want to find a workaround to my query. ...
# troubleshooting
r
Hi team, i want to find a workaround to my query. I have an upsert type records in my kafka, where there is a column with "op" operation which has values for "c"(create), "u"(update) and "d"(delete). For "c", and "u" I have handled them using upsert config in apache pinot 1.3.0 in which only the latest record with according to timestamp column will be shown there but for handling "d" I want to delete that particular primary key from the querying records. Is there any way to do so? @Mayank @Xiang Fu or anyone?
x
you can create a new column, set it in the deleteColumn field, then use transform function to fill true when
op=d
during the ingestion time.
r
Wow, that's a really great feature in upsert. Thanks @Xiang Fu. Much needed.
Hi @Xiang Fu, I was using this method to fill true or false in the "is_deleted" column then using "deleteRecordColumn": "is_deleted" in the upsert config. transformFunction: "transformConfigs": [ { "columnName": "is_deleted", "transformFunction": "CASEWHEN(op = \"d\", true, false)" },.... C.C: @Kavya
@Xiang Fu This then gave me error on the server logs like these and logs for one day reached to 60GB: Is there any other way of getting the condition statement?
x
for the transform function, use string compare not
=
Copy code
/**
   * Compare input strings lexicographically.
   * @return the value 0 if the first string argument is equal to second string; a value less than 0 if first string
   * argument is lexicographically less than the second string argument; and a value greater than 0 if the first string
   * argument is lexicographically greater than the second string argument.
   */
  @ScalarFunction
  public static int strcmp(String input1, String input2) {
    return input1.compareTo(input2);
  }
r
ah okay. Got it thanks @Xiang Fu.