Sto cercando di eseguire un'istruzione inserto con il mio HiveContext, in questo modo:"INSERT INTO ..." con SparkSQL HiveContext
hiveContext.sql('insert into my_table (id, score) values (1, 10)')
Il 1.5.2 Spark SQL Documentation non afferma esplicitamente se questa è supportata o meno, sebbene supporti "l'inserimento della partizione dinamica".
Questo porta ad una traccia dello stack come
AnalysisException:
Unsupported language features in query: insert into my_table (id, score) values (1, 10)
TOK_QUERY 0, 0,20, 0
TOK_FROM 0, -1,20, 0
TOK_VIRTUAL_TABLE 0, -1,20, 0
TOK_VIRTUAL_TABREF 0, -1,-1, 0
TOK_ANONYMOUS 0, -1,-1, 0
TOK_VALUES_TABLE 1, 13,20, 41
TOK_VALUE_ROW 1, 15,20, 41
1 1, 16,16, 41
10 1, 19,19, 44
TOK_INSERT 1, 0,-1, 12
TOK_INSERT_INTO 1, 0,11, 12
TOK_TAB 1, 4,4, 12
TOK_TABNAME 1, 4,4, 12
my_table 1, 4,4, 12
TOK_TABCOLNAME 1, 7,10, 22
id 1, 7,7, 22
score 1, 10,10, 26
TOK_SELECT 0, -1,-1, 0
TOK_SELEXPR 0, -1,-1, 0
TOK_ALLCOLREF 0, -1,-1, 0
scala.NotImplementedError: No parse rules for:
TOK_VIRTUAL_TABLE 0, -1,20, 0
TOK_VIRTUAL_TABREF 0, -1,-1, 0
TOK_ANONYMOUS 0, -1,-1, 0
TOK_VALUES_TABLE 1, 13,20, 41
TOK_VALUE_ROW 1, 15,20, 41
1 1, 16,16, 41
10 1, 19,19, 44
C'è un altro modo per inserire un tavolo alveare che è supportati?
Voglio scriverlo su un tavolo esistente. Come lo posso fare? Sto usando Spark 1.1.0, che non ha il metodo di scrittura. cosa posso fare in quel caso? –
Ti piacerebbe accettare la risposta per favore così possiamo chiudere questa domanda?:) – eliasah
@eliasah Ho fatto un'appendice nel metodo che hai specificato, ma quando faccio una selezione * sulla tabella dell'alveare sto ottenendo le righe aggiunte in alto, invece di essere nella parte inferiore – User12345