我在尝试从 Aws Glue Etl 执行 aws 示例时遇到问题 - 在本地
阅读所有这些步骤后: https ://docs.aws.amazon.com/glue/latest/dg/dev-endpoint-tutorial-local-notebook.html
并将我的端点创建为 aws 胶水。当我尝试执行此代码时:
%pyspark
import sys
from awsglue.transforms import *
from awsglue.utils import getResolvedOptions
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.job import Job
# sc = SparkContext()
#glueContext = GlueContext(sc)
glueContext = GlueContext(SparkContext.getOrCreate())
spark = glueContext.spark_session
persons = glueContext.create_dynamic_frame.from_catalog(
database="sampledb",
table_name="avro_avro_files"
)
print(persons.count())
persons.printSchema()
我有这个错误:
File "/usr/share/aws/glue/etl/python/PyGlue.zip/awsglue/__init__.py", line 13, in <module>
from dynamicframe import DynamicFrame
ImportError: No module named 'dynamicframe'
而且我不知道如何解决这个问题
我在本地有 zeppeling0.7.3 配置。
前面显示的代码的想法是,得到这个结果:
2019-04-01 11:37:22 INFO avro-test-bo: Test log message
Count: 5
root
|-- name: string
|-- favorite_number: int
|-- favorite_color: string