티스토리 뷰

hive 0.11 버전의 MetaStore로 MySQL을 사용할 경우, 해당 DB의 캐릭터셋 설정을 변경해야 합니다.


제 경우 hive 쉘은 잘 실행되는데, 실제로 mysql에 질의를 날리면 아래와 같은 오류가 발생했습니다. ^^;;

(참고로 MacBook에서 hadoop-1.2.1, hive-0.11.0, Mac용 MySQL로 테스트했습니다.)


hive> show tables;

FAILED: Error in metadata: MetaException(message:Got exception: org.apache.hadoop.hive.metastore.api.MetaException javax.jdo.JDODataStoreException: An exception was thrown while adding/validating class(es) : Specified key was too long; max key length is 767 bytes

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)

at com.mysql.jdbc.Util.getInstance(Util.java:386)

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4096)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490)

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)

at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2728)

at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2678)

at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:894)

at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:732)

at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)

at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)

at org.datanucleus.store.rdbms.table.AbstractTable.executeDdlStatement(AbstractTable.java:730)

at org.datanucleus.store.rdbms.table.AbstractTable.executeDdlStatementList(AbstractTable.java:681)

at org.datanucleus.store.rdbms.table.AbstractTable.create(AbstractTable.java:402)

at org.datanucleus.store.rdbms.table.AbstractTable.exists(AbstractTable.java:458)


이러한 오류가 발생할 때는 mysql에 root로 접속하신 후, 아래와 같이 명령어를 실행하시면 됩니다. :)


alter database 데이터베이스명 character set latin1;




저작자 표시 비영리 변경 금지
신고
댓글
댓글쓰기 폼