jmeter.functions error: jexl.parser.ParseException: Encountered "{" - jmeter

I use jmeter for loading test. I specify the "Thread Group" as "${__jexl(${LoadRatio}*1,)}". and I meet the error below. What is wrong?
2015/10/14 15:36:25 ERROR - jmeter.functions.JexlFunction: An error occurred while evaluating the expression "${LoadRatio}*1"
org.apache.commons.jexl.parser.ParseException: Encountered "{" at line 1, column 2.
Was expecting one of:
"||" ...
"or" ...
"&&" ...
"and" ...
"|" ...
"^" ...
"&" ...
"==" ...
"eq" ...
"!=" ...
"ne" ...
"<" ...
"lt" ...
">" ...
"gt" ...
"<=" ...
"le" ...
">=" ...
"ge" ...
"+" ...
"-" ...
"*" ...
"/" ...
"div" ...
"%" ...
"mod" ...
";" ...
"[" ...
"." ...
"=" ...
at org.apache.commons.jexl.parser.Parser.generateParseException(Parser.java:4176)
at org.apache.commons.jexl.parser.Parser.jj_consume_token(Parser.java:4043)
at org.apache.commons.jexl.parser.Parser.ExpressionExpression(Parser.java:1885)
at org.apache.commons.jexl.parser.Parser.Statement(Parser.java:1858)
at org.apache.commons.jexl.parser.Parser.JexlScript(Parser.java:73)
at org.apache.commons.jexl.parser.Parser.parse(Parser.java:32)
at org.apache.commons.jexl.ScriptFactory.createNewScript(ScriptFactory.java:162)
at org.apache.commons.jexl.ScriptFactory.createScript(ScriptFactory.java:99)
at org.apache.jmeter.functions.JexlFunction.execute(JexlFunction.java:79)
at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:142)
at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:118)
at kg.apc.jmeter.threads.SteppingThreadGroupGui.refreshPreview(SteppingThreadGroupGui.java:240)
at kg.apc.jmeter.threads.SteppingThreadGroupGui.modifyTestElement(SteppingThreadGroupGui.java:263)
at org.apache.jmeter.gui.GuiPackage.updateCurrentNode(GuiPackage.java:436)
at org.apache.jmeter.gui.GuiPackage.getCurrentGui(GuiPackage.java:272)
at org.apache.jmeter.gui.util.MenuFactory.addFileMenu(MenuFactory.java:224)
at org.apache.jmeter.threads.gui.AbstractThreadGroupGui.createPopupMenu(AbstractThreadGroupGui.java:82)
at org.apache.jmeter.gui.tree.JMeterTreeNode.createPopupMenu(JMeterTreeNode.java:158)
at org.apache.jmeter.gui.action.EditCommand.doAction(EditCommand.java:47)
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:81)
at org.apache.jmeter.gui.action.ActionRouter.access$000(ActionRouter.java:40)
at org.apache.jmeter.gui.action.ActionRouter$1.run(ActionRouter.java:63)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

It means that your LoadRatio variable is not defined.

Related

SonarQube - Malformed input or input contains unmappable characters

I have a Django project. It has some files with cyrillic chars in their names:
SonarQube gives error:
java.nio.file.InvalidPathException: Malformed input or input contains
unmappable characters:
src/apps/orders/sap_data_examples/ZLO_CANCEL_ORDERS/??????????
?????????????? ??????????????.json at
java.base/sun.nio.fs.UnixPath.encode(Unknown Source) at
java.base/sun.nio.fs.UnixPath.(Unknown Source) at
java.base/sun.nio.fs.UnixFileSystem.getPath(Unknown Source) at
java.base/java.nio.file.Path.resolve(Unknown Source) at
org.sonar.scm.git.IncludedFilesRepository.indexFiles(IncludedFilesRepository.java:65)
at
org.sonar.scm.git.IncludedFilesRepository.(IncludedFilesRepository.java:40)
at org.sonar.scm.git.GitIgnoreCommand.init(GitIgnoreCommand.java:37)
at
org.sonar.scanner.scan.filesystem.ProjectFileIndexer.index(ProjectFileIndexer.java:104)
at
org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:352)
at
org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at
org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at
org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:150)
at
org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at
org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72) at
org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66) at
org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method) at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source) at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at
org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source) at
org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
at
org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112) at
org.sonarsource.scanner.cli.Main.execute(Main.java:75) at
org.sonarsource.scanner.cli.Main.main(Main.java:61)
SonarQube in gitlab-ci is being started as follows:
analyze:
stage: analyze
needs: ["tests"]
dependencies:
- tests
image:
name: docker-sre.site.ru/sonarqube/scanner:${SONAR_TAG}
entrypoint: [""]
before_script:
- echo code analysis will be executed on ${SONAR_HOST}
script:
- /entrypoint.sh ${SONAR_HOST} ${SONAR_LOGIN} -X
allow_failure: true
artifacts:
when: always
reports:
junit: report.xml
coverage_report:
coverage_format: cobertura
path: coverage.xml
I supposed that the error related to cyrillic chars in file names. If so how to fix this? Maybe specify encoding some how?

FAILED: ParseException line 1:0 cannot recognize input near 'hive' '-' 'e'

I have different tables in Hive. I want to save each table in tab-separated file. How can I do it?
If I run this command, I get an error:
hive -e 'select * from myTable' > /home/mydata_tsv/myTable.tsv;
Error message:
NoViableAltException(26#[])
at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1084)
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:202)
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:437)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:320)
at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1219)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1260)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1156)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1146)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:217)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:169)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:380)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:740)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:685)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
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)
at org.apache.hadoop.util.RunJar.run(RunJar.java:233)
at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
FAILED: ParseException line 1:0 cannot recognize input near 'hive' '-' 'e'

hadoop: ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. Encountered

I am using this in my grunt shell:
customers=LOAD 'hdfs://localhost:9000/pig_data_customers' USING PigStorage(',')as (id:int, name:chararray, age:int, address:chararray, salary:double);
the data is here:
[root#localhost bin]# hdfs dfs -cat hdfs://localhost:9000/pig_data_customers
1,Ramesh,32,Ahmedabad,2000.00
2,Khilan,25,Delhi,1500.00
3,kaushik,23,Kota,2000.00
4,Chaitali,25,Mumbai,6500.00
5,Hardik,27,Bhopal,8500.00
6,Komal,22,MP,4500.00
7,Muffy,24,Indore,10000.00
I am getting error when I run:
customers=LOAD 'hdfs://localhost:9000/pig_data_customers' USING PigStorage(',')as (id:int, name:chararray, age:int, address:chararray, salary:double);
Here is the error message:
2016-06-12 17:35:11,954 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. Encountered " <PATH> "customers=LOAD "" at line 1, column 1.
Was expecting one of:
<EOF>
"cat" ...
"clear" ...
"fs" ...
"sh" ...
"cd" ...
"cp" ...
"copyFromLocal" ...
"copyToLocal" ...
"dump" ...
"\\d" ...
"describe" ...
"\\de" ...
"aliases" ...
"explain" ...
"\\e" ...
"help" ...
"history" ...
"kill" ...
"ls" ...
"mv" ...
"mkdir" ...
"pwd" ...
"quit" ...
"\\q" ...
"register" ...
"rm" ...
"rmf" ...
"set" ...
"illustrate" ...
"\\i" ...
"run" ...
"exec" ...
"%default" ...
"%declare" ...
"scriptDone" ...
"" ...
"" ...
<EOL> ...
";" ...
Can anyone tell me how do I fix the script?
Thank you very much.
Add space before and after the equals sign.
customers = LOAD 'hdfs://localhost:9000/pig_data_customers' USING PigStorage(',')as (id:int, name:chararray, age:int, address:chararray, salary:double);

Escaping double quotes in Ruby's gsub

I'm trying to minify some inline JSON as part of my HTML minifier. How do I make this:
> {"#context": "http://schema.org", "#type": "WebSite"} <
Into this:
>{ "#context": "http://schema.org", "#type": "WebSite" }<
I've tried gsub[/\", \s+\"/, ", "], gsub[/"\"}"/, "\" }"] and gsub[/"\"}"/, "\" }"] but that errors out.
syntax error, unexpected [, expecting ']' (SyntaxError)
[/"\"}"/, "\" }"]
^
syntax error, unexpected ',', expecting keyword_end
syntax error, unexpected ',', expecting keyword_end
syntax error, unexpected ']', expecting keyword_end
UPDATE
I've now also tried these but to no good:
[/>\s+{/, ">{ "] # > { => >{
[/}\s+>/, " }<"] # } < => }<
[%r/{"/, '{ %r/"'] # {" => { "
[%r/"}/, '%r/" }'] # "} => " }
[%r/",\s+/, ", "] # , " => , "
Resulting in:
syntax error, unexpected [, expecting ']' (SyntaxError)
[/}\s+>/, " }<"] # } < => }<
^
I would suggest a different approach:
require JSON
str = '{"#context": "http://schema.org", "#type": "WebSite"}'
new_str = JSON.parse(str).to_json
puts new_str
> {"#context":"http://schema.org","#type":"WebSite"}
Use a %r Regexp literal to escape all characters but one :
a = '{"#context": "http://schema.org", "#type": "WebSite"}'
a.gsub(%r/{"/, '{ "').gsub(%r/"}/, '" }').gsub(/\s+/, ' ')
#=> { "#context": "http://schema.org", "#type": "WebSite" }
using %r{ ... } escapes all characters but { and },same goes for /, (, etc ...
credit : Escaping '“' with regular double quotes using Ruby regex
It will escapes double quotes
gsub(/("|")/, 34.chr)

giraph/ hadoop reading manifest file

I am trying to run RandomWalkWith Restart example https://github.com/apache/giraph/blob/release-1.0/giraph-examples/src/main/java/org/apache/giraph/examples/RandomWalkWithRestartVertex.java
My Input is data is
12 34 56
34 78
56 34 78
78 34
and I am running
hadoop jar giraph-examples-1.1.0-for-hadoop-2.2.0-jar-with-dependencies.jar GiraphRunner -Dgiraph.zkList=<host>:port -libjars giraph-examples-1.1.0-for-hadoop-2.2.0-jar-with-dependencies.jar
org.apache.giraph.examples.RandomWalkWithRestartComputation
-mc org.apache.giraph.examples.RandomWalkVertexMasterCompute
-wc org.apache.giraph.examples.RandomWalkWorkerContext
-vof org.apache.giraph.examples.VertexWithDoubleValueDoubleEdgeTextOutputFormat
-vif org.apache.giraph.examples.LongDoubleDoubleTextInputFormat
-vip giraph_algorithms/personalized_pr/input/graph.txt
-op giraph_algorithms/personalized_pr/out1 -w 1
But I am getting this error.. :-/
Error: java.lang.IllegalStateException: run: Caught an unrecoverable exception
For input string: "PK�uE META-INF/��PKPK�uEMETA-INF/MANIFEST.MF�M��LK-.�" at
org.apache.giraph.graph.GraphMapper.run(GraphMapper.java:101) at
org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:764) at
org.apache.hadoop.mapred.MapTask.run(MapTask.java:340) at
org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:167) at
java.security.AccessController.doPrivileged(Native Method) at
javax.security.auth.Subject.doAs(Subject.java:415) at
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1554) at
org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:162) Caused by:
java.lang.NumberFormatException: For input string: "PK�uE META-INF/��PKPK�uEMETA-
INF/MANIFEST.MF�M��LK-.�" at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at
java.lang.Long.parseLong(Long.java:441) at java.lang.Long.parseLong(Long.java:483) at
org.apache.giraph.examples.RandomWalkWorkerContext.initializeSources(
RandomWalkWorkerContext.java:131) at org.apache.giraph.examples.RandomWalkWorkerContext.
setStaticVars(RandomWalkWorkerContext.java:160) at
org.apache.giraph.examples.RandomWalkWorkerContext
.preApplication(RandomWalkWorkerContext.java:146) at
org.apache.giraph.graph.GraphTaskManager.workerContextPreApp(
GraphTaskManager.java:815) at
org.apache.giraph.graph.GraphTaskManager.
prepareGraphStateAndWorkerContext(GraphTaskManager.java:451) at
org.apache.giraph.graph.GraphTaskManager.execute(GraphTaskManager.java:266) at
org.apache.giraph.graph.GraphMapper.run(GraphMapper.java:91) ... 7 more
Why is it reading manifest file.. When I specifically saying it to read a file and not even a directory?
Because you passed the libjar argument as the vertex class file.
Like the other arguments, you need to say: -D libjars=your_jar.jar.

Resources