Disable MCQA 1.0 query acceleration (interactive mode) so that subsequent SQL statements run in standard offline mode. Update the settings for the client in use, then recreate connections or restart the client.
PyODPS
Use the native SQL API
Replace the interactive APIs with the standard SQL APIs:
Replace
execute_sql_interactive(sql)withexecute_sql(sql).Replace
run_sql_interactive(sql)withrun_sql(sql).
instance = odps.execute_sql(sql)Subsequent SQL calls use the standard offline submission API.
Use SQLAlchemy
In the connection URL, replace interactive_mode=true with:
interactive_mode=falseAlternatively, remove the parameter. Its default value is false. If connect_args also contains use_sqa=True, remove that setting or change its value to False. After making these changes, release existing connections and recreate the Engine or connection pool.
Use DBAPI
Set the connection parameter use_sqa to the Python boolean False:
from odps import dbapi
conn = dbapi.connect(odps=odps, use_sqa=False)Alternatively, remove use_sqa=True. The default value is False. Use the boolean False, not the string "false". After making the change, recreate the Connection.
Java SDK
Use SQLExecutor
Explicitly set the execution mode to ExecuteMode.OFFLINE:
SQLExecutor executor = new SQLExecutorBuilder()
.odps(odps)
.executeMode(ExecuteMode.OFFLINE)
.build();Use SQLExecutorPool
When creating the pool, also explicitly set the execution mode to OFFLINE:
SQLExecutorPool pool = new SQLExecutorPoolBuilder()
.odps(odps)
.executeMode(ExecuteMode.OFFLINE)
.build();Both builders use INTERACTIVE by default. Simply removing the executeMode setting is not sufficient.
After making the change, recreate the Executor or ExecutorPool.
If the application already submits standard SQL statements through SQLTask.run(odps, sql), no additional changes are required to disable MCQA 1.0.
JDBC
Disable interactive mode in the configuration used by the application.
Use a connection URL
Replace interactiveMode=true with interactiveMode=false:
jdbc:odps:<endpoint>?project=<project>&interactiveMode=falseUse Properties
Set the following property in the existing connection Properties:
props.setProperty("interactive_mode", "false");Alternatively, remove the corresponding parameter that enables interactive mode. Interactive mode is disabled by default. If multiple configuration sources are used together (a URL, Properties, or a configuration file referenced by odps_config ), check the interactive mode settings in all of them to prevent old values from overriding the changes.
After making the changes, close existing Connections and create new ones. Applications that use a connection pool must recreate it.
odpscmd
Edit conf/odps_config.ini in the client installation directory and set the interactive mode configuration to:
enable_interactive_mode=falseAlternatively, remove enable_interactive_mode=true. Interactive mode is disabled by default.
Save the configuration, then exit and restart odpscmd. Also remove any SET or ATTACH commands that enable interactive mode from startup scripts or SQL scripts.