小编mar*_*n93的帖子

AWS S3 - 没有 gz 压缩的 Athena

我正在 AWS Athena 中使用以下语句创建一个表:

CREATE TABLE table2
WITH 
(
  format='JSON',
  external_location='s3://bucket/path'
) AS
SELECT field1, field2, field3, field4, field5, field6
FROM table1
ORDER BY field1, field2
Run Code Online (Sandbox Code Playgroud)

但是,当我查看 external_location 时,我发现所有文件都被压缩为 gz 格式。是否可以关闭压缩?也就是说,只需将原始 JSON 写入 S3 存储桶即可。

amazon-s3 amazon-athena

4
推荐指数
2
解决办法
3285
查看次数

Cakephp 3 - 单元测试验证默认

我目前正在尝试为以下模型编写单元测试:

<?php
namespace App\Model\Table;

use App\Model\Entity\User;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;

/**
 * Users Model
 *
 * @property \Cake\ORM\Association\HasMany $Comments
 * @property \Cake\ORM\Association\BelongsToMany $Albums
 */
 class UsersTable extends Table
 {

    /**
     * Initialize method
     *
     * @param array $config The configuration for the Table.
     * @return void
     */
     public function initialize(array $config)
     {
       parent::initialize($config);

       $this->table('users');
       $this->displayField('id');
       $this->primaryKey('id');

       $this->addBehavior('Timestamp');

       $this->hasMany('Comments', [
           'foreignKey' => 'user_id'
       ]);
       $this->belongsToMany('Albums', [
          'foreignKey' => 'user_id',
          'targetForeignKey' => 'album_id',
          'joinTable' => 'users_albums'
       ]);
      } …
Run Code Online (Sandbox Code Playgroud)

unit-testing cakephp cakephp-3.x

3
推荐指数
1
解决办法
1686
查看次数