2016-06-21 12 views
1

私はimpalaシェルを使用して-qを使用してinsert文を実行するためにplinkによって使用されているテキストファイルを生成しています。現在、Wikipediaのダミーデータを使用してエラーがないことを確認してから、怒りを感じます。Impala Shell query -q文字列に二重引用符を付けてください

これは、次の(私はいくつかのビットを変更したが、結果は同じである)を除いて、ほとんどすべてのインスタンスで正常に動作している:

impala-shell -c -k -q "INSERT INTO TABLE imaginarydatabasename.T_Test 
VALUES 
('Bob','Monkhouse','1928-06-01',2003,'An expert on the history of silent cinema and a film collector, Monkhouse presented Mad Movies in 1966. He wrote, produced, financed and syndicated the show worldwide. The show featured clips from comic silent films, many from his own private collection, some of which he had helped to recover and restore. This film collection was the cause of a court case at the Old Bailey in 1979. Having loaned Terry Wogan\'s son a film, Monkhouse was charged with attempting to defraud film distributors of royalties, but after two years the judge decided that there was no case to answer.[8] Many of the films in his collection were seized and not returned to Monkhouse.[9] In 2008, the British Film Institute was contacted by Monkhouse\'s daughter, Abigail, who asked if they would like to view the collection and provide some advice as to the best way of preserving it. Amongst the discoveries were many radio and TV shows long thought lost. Dick Fiddy, the archivist, said \"It\'s a huge, unwieldy collection which deals with a number of areas. It\'s not just film and TV. Initially, we found half a dozen TV shows that we knew to be missing.\" Amongst those shows rediscovered were many that feature Monkhouse himself, including The Flip Side, a 1966 play in which he starred as a television DJ with his own late night show, and the 1957/58 series of his comedy My Pal Bob including an episode in which he is suspected of an extramarital affair.[10] The archive consisted of 36,000 videotapes, going back to when Monkhouse first bought a home video recorder in 1966. His film archive began in the late 1950s. The entire Monkhouse film and television archive is now held by Kaleidoscope, including all the material previously held by the NFTVA. It was catalogued and restored to digital formats for a major event at Bafta on 24 October 2009. Chris Perry, of Kaleidoscope and Kaleidoscope Publishing, said: \"We are painstakingly transferring the important contents of the video tapes and restoring radio shows. There are many incredible finds, and the event [is] an exciting time for all concerned.\" In his final years, Monkhouse hosted a show on BBC Radio 2 called The Monkhouse Archive, in which he provided humorous links to clips of comedy acts spanning the previous 50 years.',1,2.5,'2016-06-21 14:41:25');" -i impala-server.com; 

私は外側の二重引用符の内側の部分をコピーする場合( qによって実行されているもの)、それを色相に貼り付けて実行しても問題はありません。

私が考えているのは、第5列の二重引用符が、クエリテキストが終了したシェルの-q部分に伝えられているということです。

二重引用符で終わらないとシェルに伝えるにはどうすればよいですか?

答えて

1

それはあなたがいない二回が、3回、次のようにではなく、一度それをしなければならない\

た:

impala-shell -c -k -q "INSERT INTO TABLE database.table 
VALUES 
('Bob','Monkhouse','1928-06-01',2003,'see if I can get \\\ to work...',1,2.5,'2016-06-21 14:41:25');" -i impala-server; 
1

インパラシェルがクエリを実行できるかどうかを調べるために、挿入の代わりにストレートselect文を実行する方法があります。あなたのコードから以下の例を見てください。私は問題なく実行することができましたが、エスケープ文字を取り除くとエラーになるので、二重引用符で問題を引き起こしているとは思われません。

impala-shell -i impala-server.com -c -k -q "select 'Bob','Monkhouse','1928-06-01',2003,'An expert on the history of silent cinema and a film collector, Monkhouse presented Mad Movies in 1966. He wrote, produced, financed and syndicated the show worldwide. The show featured clips from comic silent films, many from his own private collection, some of which he had helped to recover and restore. This film collection was the cause of a court case at the Old Bailey in 1979. Having loaned Terry Wogan\'s son a film, Monkhouse was charged with attempting to defraud film distributors of royalties, but after two years the judge decided that there was no case to answer.[8] Many of the films in his collection were seized and not returned to Monkhouse.[9] In 2008, the British Film Institute was contacted by Monkhouse\'s daughter, Abigail, who asked if they would like to view the collection and provide some advice as to the best way of preserving it. Amongst the discoveries were many radio and TV shows long thought lost. Dick Fiddy, the archivist, said \"It\'s a huge, unwieldy collection which deals with a number of areas. It\'s not just film and TV. Initially, we found half a dozen TV shows that we knew to be missing.\" Amongst those shows rediscovered were many that feature Monkhouse himself, including The Flip Side, a 1966 play in which he starred as a television DJ with his own late night show, and the 1957/58 series of his comedy My Pal Bob including an episode in which he is suspected of an extramarital affair.[10] The archive consisted of 36,000 videotapes, going back to when Monkhouse first bought a home video recorder in 1966. His film archive began in the late 1950s. The entire Monkhouse film and television archive is now held by Kaleidoscope, including all the material previously held by the NFTVA. It was catalogued and restored to digital formats for a major event at Bafta on 24 October 2009. Chris Perry, of Kaleidoscope and Kaleidoscope Publishing, said: \"We are painstakingly transferring the important contents of the video tapes and restoring radio shows. There are many incredible finds, and the event [is] an exciting time for all concerned.\" In his final years, Monkhouse hosted a show on BBC Radio 2 called The Monkhouse Archive, in which he provided humorous links to clips of comedy acts spanning the previous 50 years.',1,2.5,'2016-06-21 14:41:25'" 
+0

真を、以下はかなり満足だったよう: 'インパラ-shell -c -k -q "select *、 '\" Mr \ "Bobのワークショップ' AS testthing from database.table" -B -o "Test.txt" --output_delimiter = '|' --print_header -i impala-server; ' 元の文字列の大括弧やその他のものかもしれません。私は試行錯誤して何が原因であるのかを見なければならないでしょう。 –

関連する問題