我使用的是Flink SQL API,在所有“模式”类型之间,TableSchema
,Schema
(来自org.apache.flink.table.descriptors.Schema
)和TypeInformation
之间,我有点迷茫。 / p>
可以从TableSchema
创建TypeInformation
,可以从TypeInformation
创建TableSchema
,并且可以从{{ 1}}
但是看来Schema
无法转换回TableSchema
或Schema
(?)
为什么存在3种不同类型的对象来存储相同类型的信息?
例如,假设我有一个来自Avro模式文件的字符串Schema,并且我想向其中添加一个新字段。为此,我找到的唯一解决方案是:
TypeInformation
这是使用这些对象的正常方法吗? (对我来说很奇怪)
答案 0 :(得分:3)
container_commands:
01-migrations:
command: "php artisan migrate --force"
02-import:
command: "php artisan import:initial-data"
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/99_make_storage_writable.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
echo "Making /storage writeable..."
chmod -R 755 /var/app/current/storage
if [ ! -f /var/app/current/storage/logs/laravel.log ]; then
echo "Creating /storage/logs/laravel.log..."
touch /var/app/current/storage/logs/laravel.log
sudo chown -R webapp:webapp /var/app/current/storage/logs
sudo chmod -R ug+w /var/app/current/storage/logs
fi
#https://serverfault.com/a/669547/24863
"/opt/elasticbeanstalk/hooks/appdeploy/post/99_restart_workers.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
echo "Spawn worker..."
nohup php /var/app/current/artisan queue:work >/dev/null 2>&1 &
"/opt/elasticbeanstalk/tasks/publishlogs.d/laravel-logs.conf":
mode: "000755"
owner: root
group: root
content: |
/var/app/current/storage/logs/*.log
#https://stackoverflow.com/a/38751749/199700
"/etc/httpd/conf.d/https_redirect.conf":
mode: "000644"
owner: root
group: root
content: |
RewriteEngine on
<If "-n '%{HTTP:X-Forwarded-Proto}' && %{HTTP:X-Forwarded-Proto} != 'https'">
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</If>
#https://stackoverflow.com/a/38600025/199700
"/etc/php.d/project.ini" :
mode: "000644"
owner: root
group: root
content: |
upload_max_filesize=10M
post_max_size=32M
和TypeInformation
解决了不同的问题。 TableSchema
是有关如何将记录类(例如行或POJO)从一个运算符传递给另一个运算符的物理信息。
TypeInformation
描述了独立于基础每个记录类型的表的架构。它类似于TableSchema
DDL语句的架构部分。在SQL中,也没有定义类似CREATE TABLE name (a INT, b BIGINT)
的表。但是确实架构与行类型是相关的,这就是提供转换器方法的原因。一旦引入了CREATE TABLE name ROW(a INT, B BIGINT)
等概念,差异就会变得更大。
PRIMARY KEY
是指定非SQL概念(例如时间属性和字段映射)的当前方法。