中文解释argument -t/--train: Boolean value expected.
时间: 2024-04-01 07:33:49 浏览: 106
这个错误提示信息表示你为"-t"或"--train"选项提供的参数不是一个有效的布尔值。布尔值只能是"True"或者"False"。请确保你为"-t"或"--train"选项提供了一个有效的布尔值。例如,如果你想把值设为"True",你应该使用"-t True"或"--train True"。如果你想把值设为"False",你应该使用"-t False"或"--train False"。
相关问题
n file included from src/lab1/step1/step1.c:1:0: src/lab1/step1/../linklist.h: In function ‘addPoly’: src/lab1/step1/../linklist.h:62:7: error: expected identifier or ‘(’ before numeric constant PNODE 1=polyAddLeft->next; ^ src/lab1/step1/../linklist.h:65:8: warning: comparison between pointer and integer while(1!=NULL && r!=NULL) ^~ src/lab1/step1/../linklist.h:67:7: error: invalid type argument of ‘->’ (have ‘int’) if(1->exp==r->exp) ^~ src/lab1/step1/../linklist.h:70:16: error: invalid type argument of ‘->’ (have ‘int’) temp->exp=1->exp; ^~ src/lab1/step1/../linklist.h:71:17: error: invalid type argument of ‘->’ (have ‘int’) temp->coef=1->coef+r->coef; ^~ src/lab1/step1/../linklist.h:75:8: error: invalid type argument of ‘->’ (have ‘int’) 1=1->next; ^~ src/lab1/step1/../linklist.h:78:12: error: invalid type argument of ‘->’ (have ‘int’) else if(1->exp < r->exp) ^~ src/lab1/step1/../linklist.h:81:16: error: invalid type argument of ‘->’ (have ‘int’) temp->exp=1->exp; ^~ src/lab1/step1/../linklist.h:82:17: error: invalid type argument of ‘->’ (have ‘int’) temp->coef=1->coef; ^~ src/lab1/step1/../linklist.h:86:8: error: invalid type argument of ‘->’ (have ‘int’) 1=1->next; ^~ src/lab1/step1/../linklist.h:98:7: warning: comparison between pointer and integer if(1==NULL) sign=r; ^~ src/lab1/step1/../linklist.h:99:20: warning: assignment makes pointer from integer without a cast [-Wint-conversion] if(r==NULL) sign=1; ^ src/lab1/step1/../linklist.h: In function ‘printPoly’: src/lab1/step1/../linklist.h:132:7: error: expected ‘;’ before ‘printf’ printf("%dx^%d",p->coef,p->exp) ^~~~~~
从错误信息来看,程序存在语法和逻辑问题,主要是由于变量命名冲突以及对指针操作不当引起的。以下是逐条分析及解决方案:
---
### 错误 1: `expected identifier or '(' before numeric constant`
```c
PNODE 1 = polyAddLeft->next;
```
**问题**: 变量名不能直接命名为数字(如`1`)。C语言要求标识符必须以字母或下划线开头。
**解决方法**: 将变量名更改为合法的名称,例如将`1`替换为`node1`或其他合适的名称:
```c
PNODE node1 = polyAddLeft->next;
```
---
### 错误 2: `comparison between pointer and integer`
```c
while(1 != NULL && r != NULL)
```
**问题**: 这里将整数`1`与指针类型的值比较 (`NULL`) ,导致类型不匹配警告。
**解决方法**: 确保比较的是两个同类型的值。修正后的代码应如下所示:
```c
while(node1 != NULL && r != NULL)
```
---
### 错误 3: `invalid type argument of '->' (have 'int')`
```c
if(1->exp == r->exp)
temp->exp = 1->exp;
temp->coef = 1->coef + r->coef;
```
**问题**: 此处试图通过箭头运算符(`->`)访问结构体成员,但由于变量`1`是一个非法的数值型常量而非指向结构体的指针,因此无法解析其成员。
**解决方法**: 替换所有使用了非法变量名的地方,并保证正确的指针引用形式。修改后应该是类似这样的样子:
```c
if(node1->exp == r->exp){
temp->exp = node1->exp;
temp->coef = node1->coef + r->coef;
}
```
---
### 其他相关错误:
- 类似的问题还包括其他地方也出现了把数字当作节点的操作情况,均需按照上述规则逐一检查修复。
总结而言,在编写涉及链表或者其他复杂数据结构处理函数的时候一定要注意避免使用保留字、关键字作为普通变量名字;同时也要谨慎对待每一步关于指针解引用的动作是否合理合法。
---
#### 修改建议示例完整版片段
假设原有问题存在于多项式相加功能实现中,则可以参考下面这种重构过的形式:
```c
void addPoly(PNODE *polyResult, PNODE p1, PNODE p2) {
// Initialize variables correctly.
PNODE currentP1 = p1;
PNODE currentP2 = p2;
while(currentP1 || currentP2 ){
int expToInsert ;
double coefToInsert ;
if(!currentP1){
expToInsert=currentP2 ->exp ;
coefToInsert=currentP2 ->coef;
Ap
delete-target-dir --num-mappers 1 --hive-import --hive-database news --hive-table news 23/06/08 11:25:52 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7 23/06/08 11:25:53 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead. 23/06/08 11:25:53 ERROR tool.BaseSqoopTool: Error parsing arguments for import: 23/06/08 11:25:53 ERROR tool.BaseSqoopTool: Unrecognized argument: –table 23/06/08 11:25:53 ERROR tool.BaseSqoopTool: Unrecognized argument: news 23/06/08 11:25:53 ERROR tool.BaseSqoopTool: Unrecognized argument: --fields-terminated-by 23/06/08 11:25:53 ERROR tool.BaseSqoopTool: Unrecognized argument: ; 23/06/08 11:25:53 ERROR tool.BaseSqoopTool: Unrecognized argument: --delete-target-dir 23/06/08 11:25:53 ERROR tool.BaseSqoopTool: Unrecognized argument: --num-mappers 23/06/08 11:25:53 ERROR tool.BaseSqoopTool: Unrecognized argument: 1 23/06/08 11:25:53 ERROR tool.BaseSqoopTool: Unrecognized argument: --hive-import 23/06/08 11:25:53 ERROR tool.BaseSqoopTool: Unrecognized argument: --hive-database 23/06/08 11:25:53 ERROR tool.BaseSqoopTool: Unrecognized argument: news 23/06/08 11:25:53 ERROR tool.BaseSqoopTool: Unrecognized argument: --hive-table 23/06/08 11:25:53 ERROR tool.BaseSqoopTool: Unrecognized argument: news
这个错误提示显示Sqoop无法解析您提供的导入参数。具体来说,Sqoop无法识别“-table”,“-fields-terminated-by”,“-delete-target-dir”,“-num-mappers”,“-hive-import”,“-hive-database”和“-hive-table”这些参数。
请检查您的命令语法是否正确,并确保使用正确的参数名称和格式。根据错误提示,您可能需要:
1. 将“-”字符改为正确的“-”字符,因为错误提示中显示的字符可能是不正确的。
2. 在每个参数名称前添加两个“-”字符,以便Sqoop可以正确识别参数。
3. 确保使用正确的参数名称和格式。例如,“-table”应该是“--table”,“-fields-terminated-by”应该是“--fields-terminated-by”。
例如,如果您要导入一个名为“news”的表格,并将字段分隔符设置为分号“;”,可以使用以下命令:
```
sqoop import --delete-target-dir --num-mappers 1 --hive-import --hive-database news --hive-table news --fields-terminated-by ';'
```
请注意,这只是一个示例命令,具体的命令语法和参数可能因您的具体情况而有所不同。如果您不确定如何操作,请咨询有经验的管理员或参考相关文档。
阅读全文
相关推荐















