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

DataStax JIRA | dan jatnieks | 2 years ago
  1. 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
  2. 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
  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
  6. 0

    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 {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()
    2. DataStax Java Driver for Apache Cassandra - Core
      BuiltStatement.toString
      1. com.datastax.driver.core.querybuilder.Utils.appendStringIfValid(Utils.java:132)
      2. com.datastax.driver.core.querybuilder.Utils.appendFlatValue(Utils.java:120)
      3. com.datastax.driver.core.querybuilder.Utils.appendMap(Utils.java:234)
      4. com.datastax.driver.core.querybuilder.Utils.appendValueIfCollection(Utils.java:184)
      5. com.datastax.driver.core.querybuilder.Utils.appendValue(Utils.java:103)
      6. com.datastax.driver.core.querybuilder.Utils.appendValue(Utils.java:91)
      7. com.datastax.driver.core.querybuilder.Utils.joinAndAppendValues(Utils.java:57)
      8. com.datastax.driver.core.querybuilder.Insert.buildQueryString(Insert.java:59)
      9. com.datastax.driver.core.querybuilder.BuiltStatement.toString(BuiltStatement.java:182)
      9 frames
    3. com.datastax.devcenter
      ExecuteCqlScriptJobChangeAdapter$18.widgetSelected
      1. com.datastax.devcenter.common.utils.ExportTableUtils.selectionAsInsert(ExportTableUtils.java:219)
      2. com.datastax.devcenter.cql.ui.jobs.ExecuteCqlScriptJobChangeAdapter$18.widgetSelected(ExecuteCqlScriptJobChangeAdapter.java:746)
      2 frames
    4. RWT
      Display.readAndDispatch
      1. org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
      2. org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
      3. org.eclipse.swt.widgets.Display.sendEvent(Display.java:4188)
      4. org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)
      5. org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)
      6. org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475)
      7. org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279)
      8. org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4031)
      9. org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3658)
      9 frames
    5. Eclipse Workbench SWT
      PartRenderingEngine$9.run
      1. org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
      1 frame
    6. Databinding
      Realm.runWithDefault
      1. org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
      1 frame
    7. Eclipse Workbench SWT
      PartRenderingEngine.run
      1. org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
      1 frame
    8. Eclipse Workbench
      E4Workbench.createAndRunUI
      1. org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
      1 frame
    9. Eclipse UI
      Workbench$5.run
      1. org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
      1 frame
    10. Databinding
      Realm.runWithDefault
      1. org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
      1 frame
    11. Eclipse UI
      Workbench.createAndRunWorkbench
      1. org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
      1 frame
    12. Eclipse UI
      PlatformUI.createAndRunWorkbench
      1. org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
      1 frame
    13. com.datastax.devcenter
      Application.start
      1. com.datastax.devcenter.rcp.Application.start(Application.java:20)
      1 frame
    14. Equinox Container
      EclipseAppHandle.run
      1. org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
      1 frame
    15. Eclipse OSGi
      EclipseStarter.run
      1. org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
      2. org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
      3. org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
      4. org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236)
      4 frames
    16. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    17. Equinox
      Main.main
      1. org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
      2. org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
      3. org.eclipse.equinox.launcher.Main.run(Main.java:1465)
      4. org.eclipse.equinox.launcher.Main.main(Main.java:1438)
      4 frames