recherche

Maison  >  Questions et réponses  >  le corps du texte

python - Puis-je exécuter une instruction source avec pyhive?

cursor.execute("source '/home/hadoop/create_table.sql'")
Résultats d'exécution

OperationalError: TExecuteStatementResp(status=TStatus(infoMessages=["*org.apache.hive.service.cli.HiveSQLException:Error while compiling statement: FAILED: ParseException line 1:0 cannot recognize input near 'source' '/' 'home':28:27", 'org.apache.hive.service.cli.operation.Operation:toSQLException:Operation.java:388', 'org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:193', 'org.apache.hive.service.cli.operation.SQLOperation:runInternal:SQLOperation.java:276', 'org.apache.hive.service.cli.operation.Operation:run:Operation.java:324', 'org.apache.hive.service.cli.session.HiveSessionImpl:executeStatementInternal:HiveSessionImpl.java:499', 'org.apache.hive.service.cli.session.HiveSessionImpl:executeStatement:HiveSessionImpl.java:475', 'sun.reflect.GeneratedMethodAccessor10:invoke::-1', 'sun.reflect.DelegatingMethodAccessorImpl:invoke:DelegatingMethodAccessorImpl.java:43', 'java.lang.reflect.Method:invoke:Method.java:498', 'org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:78', 'org.apache.hive.service.cli.session.HiveSessionProxy:accessrrreee0:HiveSessionProxy.java:36', 'org.apache.hive.service.cli.session.HiveSessionProxy:run:HiveSessionProxy.java:63', 'java.security.AccessController:doPrivileged:AccessController.java:-2', 'javax.security.auth.Subject:doAs:Subject.java:422', 'org.apache.hadoop.security.UserGroupInformation:doAs:UserGroupInformation.java:1548', 'org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:59', 'com.sun.proxy.$Proxy34:executeStatement::-1', 'org.apache.hive.service.cli.CLIService:executeStatement:CLIService.java:270', 'org.apache.hive.service.cli.thrift.ThriftCLIService:ExecuteStatement:ThriftCLIService.java:507', 'org.apache.hive.service.rpc.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1437', 'org.apache.hive.service.rpc.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1422', 'org.apache.thrift.ProcessFunction:process:ProcessFunction.java:39', 'org.apache.thrift.TBaseProcessor:process:TBaseProcessor.java:39', 'org.apache.hive.service.auth.TSetIpAddressProcessor:process:TSetIpAddressProcessor.java:56', 'org.apache.thrift.server.TThreadPoolServer$WorkerProcess:run:TThreadPoolServer.java:286', 'java.util.concurrent.ThreadPoolExecutor:runWorker:ThreadPoolExecutor.java:1142', 'java.util.concurrent.ThreadPoolExecutor$Worker:run:ThreadPoolExecutor.java:617', 'java.lang.Thread:run:Thread.java:748', "*org.apache.hadoop.hive.ql.parse.ParseException:line 1:0 cannot recognize input near 'source' '/' 'home':32:5", 'org.apache.hadoop.hive.ql.parse.ParseDriver:parse:ParseDriver.java:207', 'org.apache.hadoop.hive.ql.parse.ParseDriver:parse:ParseDriver.java:166', 'org.apache.hadoop.hive.ql.Driver:compile:Driver.java:444', 'org.apache.hadoop.hive.ql.Driver:compileInternal:Driver.java:1242', 'org.apache.hadoop.hive.ql.Driver:compileAndRespond:Driver.java:1229', 'org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:191'], statusCode=3, sqlState='42000', errorMessage="Error while compiling statement: FAILED: ParseException line 1:0 cannot recognize input near 'source' '/' 'home'", errorCode=40000), operationHandle=None)

Le rapport d'erreur ci-dessus

三叔三叔2710 Il y a quelques jours1608

répondre à tous(1)je répondrai

  • 为情所困

    为情所困2017-06-28 09:24:35

    source /home/hadoop/create_table.sql

    répondre
    0
  • Annulerrépondre