Column Name Character Limit in MemSQL - singlestore

I have a data load job(spark connector) to MemSQL and it is failing due to the reason that the length of the column name is exceeding the permissible limit. Is there a way to fix this? I can not change the column names as they are programatically generated and I have no control on that.
The error message:
Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Identifier name '10000_BREAKING_BAD_IS_WAY_BETTER_THAN_THE_GAME_OF_THRONES_10000_LOWER_TOLERANCE' is too long
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
at com.mysql.jdbc.Util.getInstance(Util.java:360)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:978)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2526)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1618)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1549)
at com.memsql.spark.connector.DataFrameFunctions.createMemSQLTableFromSchema(DataFrameFunctions.scala:169)
at com.memsql.spark.connector.DataFrameFunctions.createMemSQLTableAs(DataFrameFunctions.scala:104)
at com.rb.pal.dm.MemSQLWriter$.main(MemSQLWriter.scala:65)
at com.rb.pal.dm.MemSQLWriter.main(MemSQLWriter.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:665)
at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:170)
at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:193)
at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:112)
at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
Is there a configuration setting which I can use to allow more characters for column names?
I am loading the data directly from parquet files into the MemSQL table
df.createMemSQLTableAs(dbName, tableName, dbHost, dbPort, user, password, useKeylessShardedOptimization = true)

Unfortunately, no. There is not an available configuration for this issue as of the time of this answer.
If possible, try configuring the length at the query generator level.

Related

I'm trying to bring some depricated code .createValueBinding to the recommend code update

Here is my current code within the application Java:
SourceActiveTab activeTab = (SourceActiveTab)fc.getApplication().createValueBinding("#{sourceActiveTab}").getValue(fc);
This is what I'm trying to replace it with based on what I have found here and the web javadocs
SourceActiveTab activeTab1 = fc.getApplication().evaluateExpressionGet(fc,"#{sourceActiveTab}", SourceActiveTab.class);
This is the error I get when trying to use the fixed code. What am I missing or doing wrong?
Root cause of ServletException.
javax.faces.el.EvaluationException: Exception while invoking expression #{sourceBaseBean.selectPersonBtn}at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:156)
at javax.faces.component.UICommand.broadcast(UICommand.java:89) at javax.faces.component.UIData.broadcast(UIData.java:517)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180) at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158) Truncated. see log file for complete stacktrace
Caused By: java.lang.NoSuchMethodError: javax.faces.application.Application.evaluateExpressionGet(Ljavax/faces/context/FacesContext;Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object; at lean.source.beans.SourceBaseBean.selectPersonBtn(SourceBaseBean.java:246)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)

cloudant apache-spark access design document

The following works for me when I just use the database name:
database = 'databasename'
cloudantdata_df = sqlContext.read.format("com.cloudant.spark").\
option("cloudant.host", host).\
option("cloudant.username", username).\
option("cloudant.password", password).\
load(database)
cloudantdata_df.printSchema()
However, when I try to load a particular design document and view name using the format like:
database = 'databasename/_design/analytics/_view/invBA'
I get the following java exception:
Py4JJavaError: An error occurred while calling o54.load.
: java.lang.RuntimeException: Database databasename/_design/analytics/_view/invBA request error: {"error":"method_not_allowed","reason":"Only GET,POST,HEAD allowed"}
at com.cloudant.spark.common.JsonStoreDataAccess.getQueryResult(JsonStoreDataAccess.scala:176)
at com.cloudant.spark.common.JsonStoreDataAccess.getMany(JsonStoreDataAccess.scala:85)
at com.cloudant.spark.DefaultSource.create(DefaultSource.scala:114)
at com.cloudant.spark.DefaultSource.createRelation(DefaultSource.scala:100)
at com.cloudant.spark.DefaultSource.createRelation(DefaultSource.scala:94)
at org.apache.spark.sql.execution.datasources.ResolvedDataSource$.apply(ResolvedDataSource.scala:158)
at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:119)
at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:507)
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:231)
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:381)
at py4j.Gateway.invoke(Gateway.java:259)
at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:133)
at py4j.commands.CallCommand.execute(CallCommand.java:79)
at py4j.GatewayConnection.run(GatewayConnection.java:209)
at java.lang.Thread.run(Thread.java:785)
Is there a way to look at a particular design document view name?
In github, there is an example how to load views:https://github.com/cloudant-labs/spark-cloudant/blob/master/examples/python/CloudantDF.py#L74
You need to use view option.
In your particular case it will be:
cloudantdata_df = sqlContext.read.format("com.cloudant.spark").\
option("cloudant.host", host).\
option("cloudant.username", username).\
option("cloudant.password", password).\
option("view","_design/analytics/_view/invBA").load(database)

Titan DB 0.5.4 (titan-0.5.4-hadoop2) , Exception after importing/load data using loadGraphSON()

I'm using Titan DB (titan-0.5.4-hadoop2) over cassandra.
Trying to export/import data with JSON format.
The save action occurs successfully, but after loadGraphSON() command, I get an Exception.
The code:
g = TitanFactory.open('../conf/titan-db.properties')
titangraph[cassandra:[localhost]]
g.saveGraphSON('../Test1233.json')
g.commit()
g.loadGraphSON('../Test1233.json')
The stack trace:
Not a single key: roles. Use addProperty instead
Display stack trace? [yN]
Not a single key: roles. Use addProperty instead
Display stack trace? [yN] y
java.lang.UnsupportedOperationException: Not a single key: roles. Use addProperty instead
at com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx.setProperty(StandardTitanTx.java:755)
at com.thinkaurelius.titan.graphdb.vertices.AbstractVertex.setProperty(AbstractVertex.java:244)
at com.thinkaurelius.titan.graphdb.vertices.AbstractVertex.setProperty(AbstractVertex.java:239)
at com.tinkerpop.blueprints.util.wrappers.batch.BatchGraph$BatchVertex.setProperty(BatchGraph.java:492)
at com.tinkerpop.blueprints.util.io.graphson.GraphSONUtility.vertexFromJson(GraphSONUtility.java:136)
at com.tinkerpop.blueprints.util.io.graphson.GraphSONReader.inputGraph(GraphSONReader.java:158)
at com.tinkerpop.blueprints.util.io.graphson.GraphSONReader.inputGraph(GraphSONReader.java:104)
at com.tinkerpop.blueprints.util.io.graphson.GraphSONReader.inputGraph(GraphSONReader.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:43)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:88)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
at com.tinkerpop.gremlin.groovy.loaders.GraphLoader$_load_closure14.doCall(GraphLoader.groovy:126)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod.invoke(ClosureMetaMethod.java:80)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at groovysh_evaluate.run(groovysh_evaluate:84)
at groovysh_evaluate$run.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at groovysh_evaluate$run.call(Unknown Source)
at org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:67)
at org.codehaus.groovy.tools.shell.Interpreter$evaluate.call(Unknown Source)
at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:152)
at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:114)
at org.codehaus.groovy.tools.shell.Shell$leftShift$0.call(Unknown Source)
at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:88)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1079)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:128)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:148)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:137)
at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:57)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1079)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:128)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:148)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:66)
at com.thinkaurelius.titan.hadoop.tinkerpop.gremlin.Console.<init>(Console.java:78)
at com.thinkaurelius.titan.hadoop.tinkerpop.gremlin.Console.<init>(Console.java:91)
at com.thinkaurelius.titan.hadoop.tinkerpop.gremlin.Console.main(Console.java:95)
gremlin>
You must have a vertex property defined in your Titan schema with Cardinality SET or LIST. When you have a collection property instead of a SINGLE property, addProperty() is what needs to be used. This is the error you're seeing.
As Matthias described in this post, the GraphSON utilities provided by Blueprints 2.5.0 does not support Titan's extended schema model. The loadGraphSON() Gremlin step you're calling on uses BatchGraph under the covers, as you can see in your stack trace. This is likely fixed in the latest Titan release 1.0, so you should consider upgrading.

Load Titan graph with Gremlin

Im toataly new with TitanDB.
Im using it with cassandra & Java:
Configuration file:
storage.backend=cassandra
storage.hostname=#CASSANDRA_CLUSTER_INNER_ADDRESS#
Java code:
TitanGraph tg = TitanFactory.open(/*the configuration above*/);
if (tg.isOpen()) {
TitanManagement tm = tg.getManagementSystem();
PropertyKey key = tm.getPropertyKey(name);
/* The rest of the nice working code */
}
The Java code works fine, I can query the graph, do CRUD operations etc...
Now, I want to query the graph without using JAVA.
At first I tried using cqlsh there I saw this:
Keyspace titan
--------------
edgestore graphindex system_properties systemlog txlog
edgestore_lock_ graphindex_lock_ system_properties_lock_ titan_ids
after digging in it I understood that I need to use tool like gremlin to query the TitanDB properly.
But when I'm tring to connect the TitanDB via gremlin I get this message:
gremlin> TitanFactory.open("cassandra.local")
No such property: TitanFactory for class: groovysh_evaluate
Display stack trace? [yN] y
groovy.lang.MissingPropertyException: No such property: TitanFactory for class: groovysh_evaluate
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
at groovysh_evaluate.run(groovysh_evaluate:51)
at groovysh_evaluate$run.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at groovysh_evaluate$run.call(Unknown Source)
at org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:67)
at org.codehaus.groovy.tools.shell.Interpreter$evaluate.call(Unknown Source)
at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:152)
at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:114)
at org.codehaus.groovy.tools.shell.Shell$leftShift$0.call(Unknown Source)
at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:88)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1079)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:128)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:148)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:137)
at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:57)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1079)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:128)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:148)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:66)
at com.tinkerpop.gremlin.groovy.console.Console.<init>(Console.java:60)
at com.tinkerpop.gremlin.groovy.console.Console.main(Console.java:102)
My question is:
How can I get Gremlin to know TitanFactory - and finally how can I work with gremlin on my existing TitanDB v. 0.5.4?
Thanks.
If you downloaded Gremlin 2.x from the TinkerPop site, I would expect to see the error you had because it does not have the Titan libraries on the classpath.
You should get the Titan 0.5.4 download from thinkaurelius and follow along with the Gremlin Shell documentation.
http://s3.thinkaurelius.com/docs/titan/0.5.4/getting-started.html#_downloading_titan_and_running_the_gremlin_shell

How to run AST transformation?

I'm trying to run the AST transformation from this example:
http://melix.github.io/ast-workshop/exercise1-hints.html
But when I run the test I get my assertions failed.
I need to compile class AuthorAdderASTTransformation first? I even did that too, added a main method and compiled it. But still test fails saying:
groovy.lang.MissingPropertyException: No such property: $AUTHOR for class: org.gr8conf.AuthorAdderASTTransformationTest
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
at org.codehaus.groovy.runtime.callsite.GetEffectivePogoPropertySite.getProperty(GetEffectivePogoPropertySite.java:86)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
at org.gr8conf.AuthorAdderASTTransformationTest.testThatAuthorExists(AuthorAdderASTTransformationTest.groovy:5)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
groovy.lang.MissingPropertyException: No such property: $AUTHOR for class: Foo
at groovy.lang.MetaClassImpl.invokeStaticMissingProperty(MetaClassImpl.java:900)
at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1729)
at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1705)
at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:3458)
at org.codehaus.groovy.runtime.callsite.ClassMetaClassGetPropertySite.getProperty(ClassMetaClassGetPropertySite.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:227)
at TestScripttestASTTransformationShouldBeDebuggableFromIDE0.run(TestScripttestASTTransformationShouldBeDebuggableFromIDE0.groovy:4)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:518)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:556)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:537)
at groovy.util.GroovyTestCase.assertScript(GroovyTestCase.java:203)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at org.gr8conf.AuthorAdderASTTransformationTest.testASTTransformationShouldBeDebuggableFromIDE(AuthorAdderASTTransformationTest.groovy:9)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
where I'm making the mistake?
The exception says that your test tried to read the property $AUTHOR, but it was not found. Assuming the transform itself is right, and that you actually ask the right class, it means it was not run. I can only assume these two points, since you didn't give any information on that.
So then onto why it was not run. AuthorAdderASTTransformation needs to be precompiled when you compile Foo. But even that is not enough, there needs to be metadata for it as well. The page http://www.groovy-lang.org/metaprogramming.html#developing-ast-xforms suggest creating a jar for it. While that is not strictly required it well prevent you forgetting the meta data file services correctly when compiling your normal source code.

Resources