我正在尝试将SQL Server表直接导入HBase,下面是sqoop导入语法
sqoop import --connect "jdbc:sqlserver://server_IP:port;databaseName=xxx" --username xxx --password xxx --table sqoop_HBase--hbase-table employeeHBase --column-family amitesh --hbase-row-key empid --hbase-create-table -m 1
这里我面临两个问题
1)如果我正在使用jdbc:sqlserver:// server_IP:port; databaseName = xxx用双引号,我收到以下错误
5 06:02:05 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6_IBM_27
17/06/05 06:02:05 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
17/06/05 06:02:05 ERROR tool.BaseSqoopTool: Error parsing arguments for import:
17/06/05 06:02:05 ERROR tool.BaseSqoopTool: Unrecognized argument: employeeHBase
17/06/05 06:02:05 ERROR tool.BaseSqoopTool: Unrecognized argument: --column-family
17/06/05 06:02:05 ERROR tool.BaseSqoopTool: Unrecognized argument: amitesh
17/06/05 06:02:05 ERROR tool.BaseSqoopTool: Unrecognized argument: --hbase-row-key
17/06/05 06:02:05 ERROR tool.BaseSqoopTool: Unrecognized argument: empid
17/06/05 06:02:05 ERROR tool.BaseSqoopTool: Unrecognized argument: --hbase-create-table
17/06/05 06:02:05 ERROR tool.BaseSqoopTool: Unrecognized argument: -m
17/06/05 06:02:05 ERROR tool.BaseSqoopTool: Unrecognized argument: 1
2)当我撤消双引号并执行命令时,我得到以下错误
--table or --query is required for import. (Or use sqoop import-all-tables.)
Try --help for usage instructions.
-bash: --username: command not found
我很确定我是错误的命令语法。虽然我错了。
答案 0 :(得分:1)
--hbase-table employeeHBase
和#include <stdio.h>
#include <stdlib.h>
#define LIVE 1
#define DEAD 0
#define xSize 10
#define ySize 10
typedef struct {
int x;
int y;
unsigned char status;
} Cell;
typedef struct {
int sizeX;
int sizeY;
Cell cell[1];
} World;
int main() {
int i, x, y;
i = 0;
World *grid = malloc(sizeof(World) + xSize * ySize * sizeof(Cell));;
grid->sizeX = xSize;
grid->sizeY = ySize;
for (x = 0; x < grid->sizeX; x++) {
for (y = 0; y < grid->sizeY; y++) {
Cell cell;
cell.x = x;
cell.y = y;
cell.status = DEAD;
printf("%d,%d: ", cell.x, cell.y);
grid->cell[i] = cell;
i++;
}
}
return 0;
}