Search code examples
javaconfigurationenvironment-variablesapache-drill

How to configure Apache Drill options as env variable?


I would like to set drill.exec.hashjoin.fallback.enabled as true in system level by starting drillbit.

I can set it during my session like alter session setdrill.exec.hashjoin.fallback.enabled=TRUE;, also I am aware of drill-override.conf file. However, how can I set it by passing an environment variable to my container such as:

    drill:
        image: drill/apache-drill
        restart: always
        environment:
            # - DRILL_EXEC_HASHJOIN_FALLBACK_ENABLED=TRUE
            # - DRILLBIT_JAVA_OPTS="-Ddrill.exec.hashjoin.fallback.enabled=true"
            - DRILLBIT_JAVA_OPTS="-Ddrill.exec.options.drill.exec.hashjoin.fallback.enabled=true"
        tty: true
        volumes:
            - orlando:/orlando
        ports:
            - "8047:8047"
            - "31010:31010"

Solution

  • Could you please clarify, whether Drill is started in embedded or distributed mode?

    For distributed mode, DRILLBIT_JAVA_OPTS=-Ddrill.exec.options.drill.exec.hashjoin.fallback.enabled=true should work as expected, but for embedded, this variable is not considered and should be used DRILL_JAVA_OPTS variable:

    - DRILL_JAVA_OPTS=-Ddrill.exec.options.drill.exec.hashjoin.fallback.enabled=true
    

    For more details about variables description, please reffer to https://github.com/apache/drill/blob/master/distribution/src/resources/runbit#L36