title: Failing to generate a filter on debezium connector with error: "op is not a valid field name"
body: <p>I have created a debezium connector to a docker MySQL container.
  I tried to set a filter for messages:</p>
  <pre><code>    {
          &quot;name&quot;: &quot;my_connector&quot;,
          &quot;config&quot;: {
              &quot;name&quot;: &quot;my_connector&quot;,
              &quot;connector.class&quot;: &quot;io.debezium.connector.mysql.MySqlConnector&quot;,
              
              ...
              
              &quot;include.schema.changes&quot;: &quot;true&quot;,
              &quot;transforms&quot;: &quot;filter, unwrap&quot;,
              &quot;transforms.unwrap.type&quot;: &quot;io.debezium.transforms.ExtractNewRecordState&quot;,
              &quot;transforms.unwrap.drop.tombstones&quot;: &quot;true&quot;,
              &quot;transforms.filter.type&quot;: &quot;io.debezium.transforms.Filter&quot;,
              &quot;transforms.filter.language&quot;: &quot;jsr223.groovy&quot;,
              &quot;transforms.filter.condition&quot;: &quot;value.source.table == 'table-name' &amp;&amp; (value.op == 'd' || value.op == 'c' || (value.op == 'u' &amp;&amp; value.after.status != value.before.status))&quot;
          }
      }
  </code></pre>
  <p>In <code>http://localhost:8070/connectors/my_connector/status</code> I see this:</p>
  <blockquote>
  <p>{
  &quot;connector&quot;:
  {
  &quot;state&quot;: &quot;RUNNING&quot;,
  &quot;worker_id&quot;: &quot;172.21.0.13:8083&quot;
  },
  &quot;name&quot;: &quot;my_connector&quot;,
  &quot;tasks&quot;:
  [
  {
  &quot;id&quot;: 0,
  &quot;state&quot;: &quot;FAILED&quot;,
  &quot;trace&quot;: &quot;org.apache.kafka.connect.errors.ConnectException: Tolerance exceeded
  in error handler\n\tat
  org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndHandleError(RetryWithToleranceOperator.java:178)\n\tat
  org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execute(RetryWithToleranceOperator.java:104)\n\tat
  org.apache.kafka.connect.runtime.TransformationChain.apply(TransformationChain.java:50)\n\tat
  org.apache.kafka.connect.runtime.WorkerSourceTask.sendRecords(WorkerSourceTask.java:320)\n\tat
  org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:245)\n\tat
  org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:184)\n\tat
  org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:234)\n\tat
  java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)\n\tat
  java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat
  java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat
  java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat
  java.base/java.lang.Thread.run(Thread.java:834)\nCaused by:
  io.debezium.DebeziumException: Error while evaluating expression
  'value.source.table == 'subscription_contract' &amp;&amp; (value.op == 'd' ||
  value.op == 'c' || (value.op == 'u' &amp;&amp; value.after.status !=
  value.before.status))' for record
  'SourceRecord{sourcePartition={server=subscription_contracts_db   },
  sourceOffset={file=binlog.000006, pos=19704, snapshot=true}}
  ConnectRecord{topic='subscription_contracts_db', kafkaPartition=0,
  key=Struct{databaseName=subscription-contracts},
  keySchema=Schema{io.debezium.connector.mysql.SchemaChangeKey:STRUCT},
  value=Struct{source=Struct{version=1.2.0.Final,connector=mysql,name=subscription_contracts_db,ts_ms=0,snapshot=true,db=subscription-contracts,table=subscription_contract,server_id=0,file=binlog.000006,pos=19704,row=0},databaseName=subscription-contracts,ddl=DROP
  TABLE IF EXISTS <code>subscription-contracts</code>.<code>subscription_contract</code>},
  valueSchema=Schema{io.debezium.connector.mysql.SchemaChangeValue:STRUCT},
  timestamp=null, headers=ConnectHeaders(headers=)}'\n\tat
  io.debezium.transforms.scripting.Jsr223Engine.eval(Jsr223Engine.java:116)\n\tat
  io.debezium.transforms.Filter.doApply(Filter.java:33)\n\tat
  io.debezium.transforms.ScriptingTransformation.apply(ScriptingTransformation.java:189)\n\tat
  org.apache.kafka.connect.runtime.TransformationChain.lambda$apply$0(TransformationChain.java:50)\n\tat
  org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndRetry(RetryWithToleranceOperator.java:128)\n\tat
  org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndHandleError(RetryWithToleranceOperator.java:162)\n\t...
  11 more\nCaused by: javax.script.ScriptException:
  org.apache.kafka.connect.errors.DataException: op is not a valid field
  name\n\tat
  org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:320)\n\tat org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:71)\n\tat
  java.scripting/javax.script.CompiledScript.eval(CompiledScript.java:89)\n\tat
  io.debezium.transforms.scripting.Jsr223Engine.eval(Jsr223Engine.java:107)\n\t...
  16 more\nCaused by: org.apache.kafka.connect.errors.DataException: op
  is not a valid field name\n\tat
  org.apache.kafka.connect.data.Struct.lookupField(Struct.java:254)\n\tat
  org.apache.kafka.connect.data.Struct.get(Struct.java:74)\n\tat
  jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown
  Source)\n\tat
  java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat
  java.base/java.lang.reflect.Method.invoke(Method.java:566)\n\tat
  org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)\n\tat
  groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)\n\tat
  org.codehaus.groovy.runtime.metaclass.MethodMetaProperty$GetMethodMetaProperty.getProperty(MethodMetaProperty.java:62)\n\tat
  org.codehaus.groovy.runtime.callsite.GetEffectivePojoPropertySite.getProperty(GetEffectivePojoPropertySite.java:63)\n\tat
  org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:329)\n\tat
  Script9.run(Script9.groovy:1)\n\tat
  org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:317)\n\t... 19 more\n&quot;,
  &quot;worker_id&quot;: &quot;172.21.0.13:8083&quot;
  }
  ],
  &quot;type&quot;: &quot;source&quot; }</p>
  </blockquote>
  <p>As <a href="https://stackoverflow.com/users/2308683/onecricketeer">OneCricketeer</a> pointed out, the basic issue here is:</p>
  <blockquote>
  <p>Caused by: javax.script.ScriptException: org.apache.kafka.connect.errors.DataException: op is not a valid field name\n\tat</p>
  </blockquote>
  <p>But I am not sure what is wrong with using it, since it seems like it
  is supposed to be a valid field - <a href="https://debezium.io/documentation/reference/stable/transformations/filtering.html" rel="nofollow noreferrer">here</a>.</p>