java.lang.IllegalArgumentException: Invalid value {value1:'Hello', value2:'Test'} of type unknown to the query builder

DataStax JIRA | Jochen Frank | 2 years ago
  1. 0
  2. 0
  3. 0

    @Enumerated broken 2.13 - Cassandra

    GitHub | 2 years ago | gncm
    java.lang.IllegalArgumentException: Invalid value INACTIVE of type unknown to the query builder
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Using {{QueryBuilder.insertInto}} for a table containing a collection of UDT's or Tuples was leading to this error: {noformat} java.lang.IllegalArgumentException: Invalid value {street:'21 Maple Drive', city:'San Jose', zip:95138, phones:{{number:'123 555 345 6', tags:{'mobile'}}}} of type unknown to the query builder at com.datastax.driver.core.querybuilder.Utils.appendStringIfValid(Utils.java:132) at com.datastax.driver.core.querybuilder.Utils.appendFlatValue(Utils.java:120) at com.datastax.driver.core.querybuilder.Utils.appendMap(Utils.java:234) at com.datastax.driver.core.querybuilder.Utils.appendValueIfCollection(Utils.java:184) at com.datastax.driver.core.querybuilder.Utils.appendValue(Utils.java:103) at com.datastax.driver.core.querybuilder.Utils.appendValue(Utils.java:91) at com.datastax.driver.core.querybuilder.Utils.joinAndAppendValues(Utils.java:57) at com.datastax.driver.core.querybuilder.Insert.buildQueryString(Insert.java:59) at com.datastax.driver.core.querybuilder.BuiltStatement.toString(BuiltStatement.java:182) at com.datastax.devcenter.common.utils.ExportTableUtils.selectionAsInsert(ExportTableUtils.java:219) at com.datastax.devcenter.cql.ui.jobs.ExecuteCqlScriptJobChangeAdapter$18.widgetSelected(ExecuteCqlScriptJobChangeAdapter.java:746) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4188) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4031) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3658) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at com.datastax.devcenter.rcp.Application.start(Application.java:20) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) at org.eclipse.equinox.launcher.Main.run(Main.java:1465) at org.eclipse.equinox.launcher.Main.main(Main.java:1438) {noformat} The cause of this is because the {{Utils.appendValueIfCollection}} method leads to {{appendFlatValue}} being called and this method only handles literals and strings - not collections or UDTs or Tuples. The reason for {{appendFlatValue}} seems to be to avoid nested collections, but it should at least handle UDTs and Tuples.

    DataStax JIRA | 2 years ago | dan jatnieks
    java.lang.IllegalArgumentException: Invalid value {street:'21 Maple Drive', city:'San Jose', zip:95138, phones:{{number:'123 555 345 6', tags:{'mobile'}}}} of type unknown to the query builder
  6. 0

    Using {{QueryBuilder.insertInto}} for a table containing a collection of UDT's or Tuples was leading to this error: {noformat} java.lang.IllegalArgumentException: Invalid value {street:'21 Maple Drive', city:'San Jose', zip:95138, phones:{{number:'123 555 345 6', tags:{'mobile'}}}} of type unknown to the query builder at com.datastax.driver.core.querybuilder.Utils.appendStringIfValid(Utils.java:132) at com.datastax.driver.core.querybuilder.Utils.appendFlatValue(Utils.java:120) at com.datastax.driver.core.querybuilder.Utils.appendMap(Utils.java:234) at com.datastax.driver.core.querybuilder.Utils.appendValueIfCollection(Utils.java:184) at com.datastax.driver.core.querybuilder.Utils.appendValue(Utils.java:103) at com.datastax.driver.core.querybuilder.Utils.appendValue(Utils.java:91) at com.datastax.driver.core.querybuilder.Utils.joinAndAppendValues(Utils.java:57) at com.datastax.driver.core.querybuilder.Insert.buildQueryString(Insert.java:59) at com.datastax.driver.core.querybuilder.BuiltStatement.toString(BuiltStatement.java:182) at com.datastax.devcenter.common.utils.ExportTableUtils.selectionAsInsert(ExportTableUtils.java:219) at com.datastax.devcenter.cql.ui.jobs.ExecuteCqlScriptJobChangeAdapter$18.widgetSelected(ExecuteCqlScriptJobChangeAdapter.java:746) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4188) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4031) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3658) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at com.datastax.devcenter.rcp.Application.start(Application.java:20) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) at org.eclipse.equinox.launcher.Main.run(Main.java:1465) at org.eclipse.equinox.launcher.Main.main(Main.java:1438) {noformat} The cause of this is because the {{Utils.appendValueIfCollection}} method leads to {{appendFlatValue}} being called and this method only handles literals and strings - not collections or UDTs or Tuples. The reason for {{appendFlatValue}} seems to be to avoid nested collections, but it should at least handle UDTs and Tuples.

    DataStax JIRA | 2 years ago | dan jatnieks
    java.lang.IllegalArgumentException: Invalid value {street:'21 Maple Drive', city:'San Jose', zip:95138, phones:{{number:'123 555 345 6', tags:{'mobile'}}}} of type unknown to the query builder

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Invalid value {value1:'Hello', value2:'Test'} of type unknown to the query builder

      at com.datastax.driver.core.querybuilder.Utils.appendStringIfValid()
    2. DataStax Java Driver for Apache Cassandra - Core
      BuiltStatement.toString
      1. com.datastax.driver.core.querybuilder.Utils.appendStringIfValid(Utils.java:133)
      2. com.datastax.driver.core.querybuilder.Utils.appendFlatValue(Utils.java:121)
      3. com.datastax.driver.core.querybuilder.Utils.appendMap(Utils.java:235)
      4. com.datastax.driver.core.querybuilder.Utils.appendValueIfCollection(Utils.java:185)
      5. com.datastax.driver.core.querybuilder.Utils.appendValue(Utils.java:104)
      6. com.datastax.driver.core.querybuilder.Utils.appendValue(Utils.java:92)
      7. com.datastax.driver.core.querybuilder.Assignment$CollectionAssignment.appendTo(Assignment.java:153)
      8. com.datastax.driver.core.querybuilder.Utils.joinAndAppend(Utils.java:40)
      9. com.datastax.driver.core.querybuilder.Update.buildQueryString(Update.java:70)
      10. com.datastax.driver.core.querybuilder.BuiltStatement.toString(BuiltStatement.java:186)
      10 frames