- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用批量加载器从一个 GAE 服务器下载我的评论 类型并上传到另一个 GAE 服务器。这种评论 类型包含大约 30,000 个实体。
我使用命令上传:
appcfg.py upload_data --kind=Review --filename=review.csv --application=<MY_APP_ID> --url=http://<MY_APP_ID>.appspot.com/remote_api --rps_limit=500 --bandwidth_limit=2500000 --batch_size=100
注意:整个错误很长。所以我把它放在了这个问题的底部。
上传根本没有开始,并在以下行停止:[INFO] Opening database: bulkloader-progress-20110611.222101.sql3
我在整个跟踪的底部看到:lambda val: _EPOCH + datetime.timedelta(microseconds=val), OverflowError: date value out of range
我怀疑这是由于在我的 publisheddate 列中发现格式错误的日期造成的(请参阅下面的完整评论 类型)。
我在 GAE 管理门户中运行了 GQL:SELECT * FROM Review where publisheddate = null
,发现大约 15 个实体的 publisheddate< 为 null 值/strong> 专栏。所以我删除了那些,重新下载并尝试重新上传评论类型。我仍然遇到同样的错误。
我在想,因为我使用的是没有配置文件参数的上传命令,例如--config_file=bulkloader.yaml
(见上面上传我没有指定--config_file
)
我依靠数据存储区统计信息来确定下载到我的 review.csv 文件的内容。
现在,因为我刚刚删除了带有 null publisheddate 的实体,所以重新下载然后立即重新上传与我最初的下载和上传没有任何不同。由于数据存储区统计信息尚未更新。
由于有 30, 000 个实体,我不确定如何找到日期格式错误的实体。是否有快速定位具有错误 publisheddate 值的实体的方法?
有谁知道如何解决这个问题?从错误跟踪中我不确定真正的问题是什么。
我正在使用 objectify3.0.jar 来操作我的 GAE 数据存储。所以我的评论类看起来是这样的:
public class Review {
@Id private Long id; //This is my key property, auto generated by objectify
private String reviewlink;
private Date publisheddate;
private double rating;
private Long gameid; //to make querying easier
//ommitting getters and setters
}
10:20:48>appcfg.py upload_data --kind=Review --filename=review.csv --application=<MY_APP_ID> --url=http://<MY_APP_ID>.appspot.com/remote_api --rps_limit=500 --bandwidth_limit=2500000 --batch_size=100
Uploading data records.
[INFO ] Logging to bulkloader-log-20110611.222101
[INFO ] Throttling transfers:
[INFO ] Bandwidth: 2500000 bytes/second
[INFO ] HTTP connections: 8/second
[INFO ] Entities inserted/fetched/modified: 500/second
[INFO ] Batch Size: 100
[INFO ] Opening database: bulkloader-progress-20110611.222101.sql3
Traceback (most recent call last):
File "/usr/local/bin/appcfg.py", line 76, in <module>
run_file(__file__, globals())
File "/usr/local/bin/appcfg.py", line 72, in run_file
execfile(script_path, globals_)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3592, in <module>
main(sys.argv)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3583, in main
result = AppCfgApp(argv).Run()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 2229, in Run
self.action(self)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3368, in __call__
return method()
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3195, in PerformUpload
run_fn(args)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py", line 3087, in RunBulkloader
sys.exit(bulkloader.Run(arg_dict))
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/bulkloader.py", line 4360, in Run
return _PerformBulkload(arg_dict)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/bulkloader.py", line 4204, in _PerformBulkload
loader.initialize(filename, loader_opts)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/bulkloader.py", line 2879, in initialize
self.high_id_table = self._find_high_id(self.generate_records(filename))
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/bulkloader.py", line 2896, in _find_high_id
for values in record_generator:
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/bulkloader.py", line 2920, in generate_records
yield datastore.Entity._FromPb(fixed_entity_proto)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/datastore.py", line 958, in _FromPb
value = datastore_types.FromPropertyPb(prop)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/datastore_types.py", line 1792, in FromPropertyPb
value = conversion(value)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/datastore_types.py", line 1722, in <lambda>
lambda val: _EPOCH + datetime.timedelta(microseconds=val),
OverflowError: date value out of range
最佳答案
我用来查找有问题的行的方法是使用批量加载器WITH 一个配置文件来下载每一行,直到它到达无法下载的行。纠正有问题的行后,下载/上传工作正常。
注意:事实上,它是多行,但一旦我找到第一行,只需用有问题的数据查找/替换其他行即可。
我用来查找行的命令是:
appcfg.py upload_data --coinfig_file=bulkloader.yaml --kind=Review --filename=review.csv --application=<MY_APP_ID> --url=http://<MY_APP_ID>.appspot.com/remote_api --rps_limit=500 --bandwidth_limit=2500000 --batch_size=100
注意:在我上面的问题中,我没有使用配置文件。在上面的这个命令中。我正在使用配置文件。此配置文件是使用此命令从数据存储区统计信息生成的:
appcfg.py create_bulkloader_config --filename=bulkloader.yaml --application=<appname> --url=http://<appname>.appspot.com/remote_api
使用配置文件的主要原因是它下载我的数据存储,格式为正确的 csv 文件。
出于某种原因,当您没有为批量加载程序指定配置文件时。下载的 csv 很乱,即它包含很多随机字符。但是,将这些文件上传回您的数据存储没有问题。
为什么格式正确的 csv 文件和这些杂乱的 csv 文件在上传到您的数据存储时都能正常工作?
实际问题是 publisheddate
属性的某些数据的值设置为 00/00/0000 (MM/DD/YYYY)。 Java 将其转换为 Date
,值为 Sunday 2nd January 0001(不要引用我的值,但我记得它是 0001 年)。
这可以很好地插入到 GAE 数据存储中,但是当批量加载程序尝试下载或上传这些值时,它会报错:lambda val: _EPOCH + datetime.timedelta(microseconds=val), OverflowError : 日期值超出范围
如上所示。
关于Java Google App Engine 批量加载器上传错误 “OverflowError: date value out of range”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6316096/
数据框有一个字符串类型的日期列 '2017-01-01' 它被转换为 DateType() df = df.withColumn('date', col('date_string').cast(Dat
这个问题在这里已经有了答案: What is "x && foo()"? (5 个答案) 关闭 8 年前。 我在 bootstrap-datepicker.js 文件中遇到过这个。 作者在_setD
我有一个数据库 utc 字符串,我正在传递到 Date(attrs.endDate),然后通过 new Date() 减去当前的 utc 日期,但我无法得到它来为我提供 2 个 utc 日期的正确差异
这个问题在这里已经有了答案: how to determine if 2 dates object equals each other? [duplicate] (3 个答案) 关闭 6 年前。 我
这个问题已经有答案了: How can I convert "/Date(1399739515000)/" into date format in JavaScript? (3 个回答) 已关闭 8
根据MDN ,我们只能将以下类型的参数传递给 Date 构造函数: new Date(); new Date(value); // Unix timestamp new Date(dateString
我从表中获取所有项目: endDate >= 现在 endDate 为 NULL published 等于 1。 这是我所拥有的,但它给了我 0 个项目: $items = Items::orderB
此查询需要很长时间才能完成。当我将 WHERE 子句设置为 new_dl >= '2014-01-01' 时,查询大约需要 6 分钟才能浏览大约 3 个月的数据。现在不知道为什么这个应该从 12 个月
我有一个正在为项目开发的小型 Java 程序,它使用 JavaMail 从指定的 URI 中提取用户的收件箱,然后开始处理消息。 在 Outlook 中,属性菜单中有一个功能可以设置邮件的到期日期,它
我想在获取 Date.getHours()、Date.getMinutes() 和 Date.getSeconds() 的值后格式化输出>. 这是一条漫长的路: var dt = new Date()
我发现java.text.DateFormat有两种格式化日期的方法。一种是采用 Date 参数,另一种是采用 Object 参数。我检查了DateFormat源代码,似乎他们调用了不同的内部方法。
我有两个对象,p4 和 p5,它们都具有 Date 属性。在某些时候,构造函数工作正常: p4.setClickDate(new Date(System.currentTimeMillis() - 8
我是使用 Sequelize 和 Node.js 的新手,但我的代码中存在日期比较问题。 User.findOne({ where: { resetToken: passwordToken,
我正在使用一个名为 fullcalendar 的 jquery 日历。当用户单击某一天时,他们将被发送到另一个页面以创建该天的事件。单击的日期作为 date 提供。然后通过下面的函数运行将其转换为 U
我有一个列表列表,每个列表中都有整数值,代表 8 年期间的日期。 dates = [[2014, 11, 14], [2014, 11, 13], ....., [2013, 12, 01]
我有两个表: 首先是TimeValues(示例) time | value 12/28/18 | 5.6 01/03/19 | 5.6 01/04/19 | 5.6 01/09/19 | 5.
关闭。这个问题需要debugging details .它目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and th
像这样实例化的日期对象: new Date("2011-12-13") 返回一个认为自己是星期一的日期对象: Date {Mon Dec 12 2011 16:00:00 GMT-0800 (PST)
我需要选择入住日期和退房日期在指定日期范围之间的房价。这些费率根据其条件单独命名。房费取决于所选日期。这是我的代码: rate_eb rate_name rate_starts rat
我有 [Int64:[String:String]] 其中 Int64 是时间戳。如何检测和删除 [String:String] 中的参数之一是 ["name"] = "test" 并重复多次的同一天
我是一名优秀的程序员,十分优秀!