Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-2863

Double caret bug in sample.sh for old version bash

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • v2.0.0, v2.1.0
    • v2.2.0
    • Tools, Build and Test
    • OS: SuSE 11 sp4
      Hortonworks hdp 2.6.1.0-129
      hadoop 2.7.3
      hbase 1.1.2
      hive 1.2.1
      jdk 1.8.0
    • Patch, Important

    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!

      Attachments

        Issue Links

          Activity

            People

              mahongbin Hongbin Ma
              tina437213 TING WANG
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: