我有一个包含 10609 行的数据框,我想一次将 100 行转换为 JSON 并将它们发送回网络服务。
我曾尝试使用 SQL 的 LIMIT 子句,例如
temptable = spark.sql("select item_code_1 from join_table limit 100")
Run Code Online (Sandbox Code Playgroud)
这将返回前 100 行,但如果我想要接下来的 100 行,我试过这个但没有用。
temptable = spark.sql("select item_code_1 from join_table limit 100, 200")
Run Code Online (Sandbox Code Playgroud)
错误:Py4JJavaError:调用 o22.sql 时发生错误。: org.apache.spark.sql.catalyst.parser.ParseException: 不匹配的输入 ',' 期望(第 1 行,位置 44)
== SQL ==
select item_code_1 from join_table limit 100, 200
Run Code Online (Sandbox Code Playgroud) 我有一个字符串变量,其中包含结构的名称.此结构在头文件中声明.我想基于结构名称的值创建一个结构的对象,该结构名称保存在C++的字符串变量中.
struct myStruct{
int a;
char b;
};
string structName = "myStruct";
// Instantiate a structure variable [like this: "struct myStruct"]
Run Code Online (Sandbox Code Playgroud)
有人可以帮我这个吗?