我在CSV数据文件中有数百万个长号( // I am just copying the json string as is but you will need to escape it properly for java.
DataType dt = DataType.fromJson({"type":"struct","fields":[{"name":"companyid","type":"string","nullable":false,"metadata":{}},{"name":"loyaltynum","type":"integer","nullable":false,"metadata":{}},{"name":"totalprice","type":"integer","nullable":false,"metadata":{}},{"name":"itemcount","type":"integer","nullable":false,"metadata":{}}]})
),我想减小文件大小。我计划通过将尽可能多的尾随数字四舍五入为0来实现此目的,同时保持在原始数字的5216672577
%精度内。然后我将数字转换为科学记数法。我更喜欢格式X
到103e7
。句点和加号添加了不必要的字节。我正在使用整数。
更新 - 我开始工作了
1.03E+7