我安装pyspark了pip. 我在jupyter笔记本中编码。一切正常,但不是我java在导出大.csv文件时遇到堆空间错误。
这里有人建议编辑spark-defaults.config. 同样在火花文档中,它说
"注意:在客户端模式下,这个配置不能直接在你的应用程序中通过 SparkConf 设置,因为驱动 JVM 已经启动了。相反,请通过 --driver-memory 命令行选项或在你的默认属性文件。”
但恐怕是在安装时没有这样的文件pyspark有pip。我说得对吗?我该如何解决这个问题?
谢谢!
我尝试编写一个非常简短的脚本只是为了打开一个hdf5文件,但它不起作用.
#include <iostream>
#include "H5Cpp.h"
#ifndef H5_NO_NAMESPACE
using namespace H5;
#endif
const H5std_string FILE_NAME( "testfile.h5" );
int main (void)
{
H5File openFile( FILE_NAME, H5F_ACC_RDONLY );
}
Run Code Online (Sandbox Code Playgroud)
我很确定我包含了hdf5库和包含的路径.但是,我从链接器收到错误消息:
Invoking: GCC C++ Linker
g++ -L/usr/local/pub/lib64 -L/usr/local/pub/lib -L/lib64 -L/usr/lib64 -o "HDF5_CPP" ./openfile.o
./openfile.o: In function `main':
/athome/augs_ay/workspace/HDF5_CPP/Debug/../openfile.cpp:18: undefined reference to `H5check_version'
/athome/augs_ay/workspace/HDF5_CPP/Debug/../openfile.cpp:18: undefined reference to `H5::FileAccPropList::DEFAULT'
/athome/augs_ay/workspace/HDF5_CPP/Debug/../openfile.cpp:18: undefined reference to `H5::FileCreatPropList::DEFAULT'
/athome/augs_ay/workspace/HDF5_CPP/Debug/../openfile.cpp:18: undefined reference to `H5::H5File::H5File(std::string const&, unsigned int, H5::FileCreatPropList const&, H5::FileAccPropList const&)'
/athome/augs_ay/workspace/HDF5_CPP/Debug/../openfile.cpp:18: undefined reference to `H5::H5File::~H5File()'
collect2: error: ld returned 1 …Run Code Online (Sandbox Code Playgroud) 我刚刚开始使用 C 和 HDF5,所以我的问题可能很容易回答。
我尝试使用http://beige.ucs.indiana.edu/I590/node122.html中的示例代码来创建 HDF5 文件。
#include "hdf5.h"
#define FILE "file.h5"
main() {
hid_t file_id; /* file identifier */
herr_t status;
/* Create a new file using default properties. */
file_id = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/* Terminate access to the file. */
status = H5Fclose(file_id);
}
Run Code Online (Sandbox Code Playgroud)
我尝试用 Eclipse 编译它并收到 5 条错误消息:
make: *** [Read_HDF5] Error 1
skipping incompatible /usr/lib/libc.so when searching for -lc
undefined reference to `H5check_version'
undefined reference to `H5Fcreate'
undefined reference to `H5Fclose'
Run Code Online (Sandbox Code Playgroud)
什么地方出了错?
谢谢你的帮助!
根据GitHub 上的 JsonPath,应该可以访问数组的 max()、min() 或 sum(),但我不知道如何访问。使用此示例数据:
{
"store": {
"book": [
{
"category": "reference",
"author": "Nigel Rees",
"title": "Sayings of the Century",
"price": 8.95
},
{
"category": "fiction",
"author": "Evelyn Waugh",
"title": "Sword of Honour",
"price": 12.99
},
{
"category": "fiction",
"author": "Herman Melville",
"title": "Moby Dick",
"isbn": "0-553-21311-3",
"price": 8.99
},
{
"category": "fiction",
"author": "J. R. R. Tolkien",
"title": "The Lord of the Rings",
"isbn": "0-395-19395-8",
"price": 22.99
}
],
"bicycle": {
"color": "red",
"price": 19.95 …Run Code Online (Sandbox Code Playgroud) 我尝试读取属性的内容。我使用C ++和HDF5 API。我的脚本如下所示:
#include <iostream>
#include <string>
#ifndef H5_NO_NAMESPACE
#ifndef H5_NO_STD
using std::cout;
using std::endl;
#endif // H5_NO_STD
#endif
#include "H5Cpp.h"
#ifndef H5_NO_NAMESPACE
using namespace H5;
#endif
const H5std_string FILE_NAME ("file.h5");
const H5std_string GROUP_NAME_what ("here/where");
int main (void)
{
H5File file( FILE_NAME, H5F_ACC_RDONLY );
/*
* open Group and Attribute
*/
Group what= file.openGroup( GROUP_NAME_what );
Attribute attr = what.openAttribute("lat");
H5std_string test;
DataType type = attr.getDataType();
attr.read(type,test);
cout << test << endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
应该写的test是:
ATTRIBUTE "lat" …Run Code Online (Sandbox Code Playgroud) 我想将一个浮点数传递给另一个函数.
int main()
{
float start=0;
float step=0.1;
int number=10;
fun(start,step,number)
}
fun(float star, float ste, int numbe)
{
//here I get "star = 0", "numbe = 10", but "ste = -1.084264e-19"
}
Run Code Online (Sandbox Code Playgroud)
这有什么不对?
谢谢