You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by TING WANG <wa...@cmbc.com.cn> on 2017/09/09 13:25:39 UTC

Review Request 62204: kylin-2863, fix the double caret bug in sample.sh when executed in old bash version of some enterprise OS

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62204/
-----------------------------------------------------------

Review request for kylin.


Repository: kylin


Description
-------

When an old version bash is used, the following error will occur:
/apache-kylin-2.0.0-bin/bin # ./sample.sh
Retrieving hadoop conf dir...
Retrieving hadoop conf dir...
KYLIN_HOME is set to /usr/share/kylin/apache-kylin-2.0.0-bin
Loading sample data into HDFS tmp path: /tmp/kylin/sample_cube/data
./sample.sh: line 40: ${sample_database^^}: bad substitution
Going to create sample tables in hive to database default by cli
......
If you ignore the error above, another error will occur when building cube:
java.lang.IllegalStateException: No resource found at -- /table/DEFAULT.KYLIN_SALES.json
at org.apache.kylin.engine.mr.common.AbstractHadoopJob.dumpResources(AbstractHadoopJob.java:550)
at org.apache.kylin.engine.mr.common.AbstractHadoopJob.dumpKylinPropsAndMetadata(AbstractHadoopJob.java:505)
at org.apache.kylin.engine.mr.common.AbstractHadoopJob.attachCubeMetadata(AbstractHadoopJob.java:458)
at org.apache.kylin.engine.mr.steps.FactDistinctColumnsJob.run(FactDistinctColumnsJob.java:122)
at org.apache.kylin.engine.mr.MRUtil.runMRJob(MRUtil.java:102)
at org.apache.kylin.engine.mr.common.MapReduceExecutable.doWork(MapReduceExecutable.java:123)
at org.apache.kylin.job.execution.AbstractExecutable.execute(AbstractExecutable.java:124)
at org.apache.kylin.job.execution.DefaultChainedExecutable.doWork(DefaultChainedExecutable.java:64)
at org.apache.kylin.job.execution.AbstractExecutable.execute(AbstractExecutable.java:124)
at org.apache.kylin.job.impl.threadpool.DefaultScheduler$JobRunner.run(DefaultScheduler.java:142)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
result code:2
The reason is that the Bash version in SuSE 11 sp4 enterprise is quite old:
~/#: bash -version
bash -version
GNU bash, version 3.2.57(1)-release (x86_64-suse-linux-gnu)
Copyright (C) 2007 Free Software Foundation, Inc.
Instead of using double carets to convert the string to uppercase, we can use the tr command to do the same job as shown in this pr which has higher compatibility for various kinds of OS.
Thanks!


Diffs
-----

  build/bin/sample.sh dc98665 


Diff: https://reviews.apache.org/r/62204/diff/1/


Testing
-------

All tests passed


Thanks,

TING WANG